Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.41 KB | None | 0 0
  1. """
  2. Author: Darrin Schultz @conchoecia
  3. File: Transcriptome assembly, annotation, and db creation
  4.  
  5. Instructions:
  6. - To run this script and all of its analyses: make sure that python 3,
  7. snakemake, and biopython are installed on your Unix computer.
  8. - Execute the following command: `snakemake --cores 45`, replacing `45`
  9. with the number of threads available on your machine.
  10. """
  11. import os
  12. import sys
  13. from Bio import SeqIO
  14. import shutil
  15.  
  16. configfile: "config.yaml"
  17. trimmomatic = "/usr/local/bin/Trimmomatic-0.35"
  18. maxthreads = 90
  19. dockeruser = "YOUR_USERNAME_HERE"
  20. curr_dir = os.getcwd()
  21. print(curr_dir)
  22.  
  23. config["rna_f"] = {}
  24. config["rna_r"] = {}
  25. config["input_reads"] = []
  26. for sample in config["samples"]:
  27. config["input_reads"].append(config["samples"][sample]["f"])
  28. config["input_reads"].append(config["samples"][sample]["r"])
  29.  
  30. # Now we need to change how the SS_lib_type_param is handled
  31. for sample in config["samples"]:
  32. thisss_lib = config["samples"][sample]["SS_lib_type"]
  33. if thisss_lib in ["None", "NA", "none", "no", "nein"]:
  34. config["samples"][sample]["SS_lib_type"] = ""
  35. elif thisss_lib in ["rf", "RF", "Rf", "rF"]:
  36. config["samples"][sample]["SS_lib_type"] = "--SS_lib_type RF"
  37. elif thisss_lib in ["fr", "FR", "Fr", "fR"]:
  38. config["samples"][sample]["SS_lib_type"] = "--SS_lib_type FR"
  39.  
  40. def read_number_from_file(filename):
  41. with open(filename, "r") as f:
  42. for line in f:
  43. if line.strip():
  44. return line.strip()
  45.  
  46. def singleline_to_multiline(infile, outfile):
  47. """
  48. This function takes a fasta file and wraps it to N characters
  49. """
  50. out_handle = open(outfile, 'w') #open outfile for writing
  51.  
  52. with open(infile, "rU") as handle:
  53. for record in SeqIO.parse(handle, "fasta"):
  54. SeqIO.write(record, out_handle, "fasta")
  55. out_handle.close()
  56.  
  57. rule all:
  58. input:
  59. #make the symlinks
  60. expand("reads/{sample}_f.fastq.gz", sample = config["samples"]),
  61. expand("reads/{sample}_r.fastq.gz", sample = config["samples"]),
  62. ##trim the reads
  63. expand("trimmed/{sample}_{readtype}.trim.fastq.gz", sample = config["samples"], readtype = ["f", "r"]),
  64. #now assemble the transcriptomes
  65. expand("txomes/raw/trinity_{sample}_raw.fasta", sample = config["samples"]),
  66. # make it multi-line
  67. expand("txomes/final/{sample}.fasta", sample = config["samples"]),
  68. # transdecoder and translate, rename the pep files
  69. expand("pepfiles/final/{sample}.pep", sample = config["samples"]),
  70. # softlinks for /data/ncbi/db
  71. expand("/data/ncbi/db/{sample}.fasta", sample = config["samples"]),
  72. expand("/data/ncbi/db/{sample}.pep", sample = config["samples"]),
  73. # make the blast databases
  74. expand("/data/ncbi/db/{sample}.fasta.nhr", sample = config["samples"]),
  75. expand("/data/ncbi/db/{sample}.pep.phr", sample = config["samples"]),
  76. expand("/data/ncbi/db/{sample}.dmnd", sample = config["samples"]),
  77. # make the report
  78. expand("info/counts/raw/{sample}_raw_count.txt", sample = config["samples"]),
  79. expand("info/counts/trimmed/{sample}_trimmed_count.txt", sample = config["samples"]),
  80. expand("info/trimming/txome/{sample}_qual_rejects.txt", sample = config["samples"]),
  81. expand("info/trimming/txome/{sample}_adapter_rejects.txt", sample = config["samples"]),
  82. expand("info/trimming/txome/{sample}_gc_rejects.txt", sample = config["samples"]),
  83. expand("info/counts/fasta/{sample}_fasta_count.txt", sample = config["samples"]),
  84. expand("info/counts/peps/{sample}_pep_count.txt", sample = config["samples"]),
  85. expand("info/counts/fasta/{sample}_N50.txt", sample = config["samples"]),
  86. expand("info/counts/peps/{sample}_N50.txt", sample = config["samples"]),
  87. expand("info/counts/fasta/{sample}_meanlen.txt", sample = config["samples"]),
  88. expand("info/counts/fasta/{sample}_N90.txt", sample = config["samples"]),
  89. expand("info/counts/fasta/{sample}_mb.txt", sample = config["samples"]),
  90. "report/final_report.txt"
  91.  
  92. ###############################################################
  93. # __ __ ___ __ __ __ __ ___ __ __ _ __
  94. # |__) |__) |__ |__) |__) / \ / ` |__ /__` /__` | |\ | / _`
  95. # | | \ |___ | | \ \__/ \__, |___ .__/ .__/ | | \| \__>
  96. #
  97. # These are the rules for preprocessing the inputs in order
  98. # to prepare for the rest of the pipeline.
  99.  
  100. # preprocessing rule 1
  101. rule make_symlink_f:
  102. output:
  103. illumina_f = "reads/{sample}_f.fastq.gz",
  104. run:
  105. if not os.path.exists("reads"):
  106. print("Making a directory called 'reads'.", file = sys.stderr)
  107. os.makedirs("reads")
  108. else:
  109. print("The 'reads' directory exists already.", file = sys.stderr)
  110.  
  111. #make symlinks for the illumina reads
  112. print("Making read symlinks.", file =sys.stderr)
  113. print(" - Checking files for sample {}".format(wildcards.sample), file=sys.stderr)
  114. rna_f = "reads/{}_f.fastq.gz".format(wildcards.sample)
  115. if not os.path.exists(rna_f):
  116. print(" - Making a symlink for {}".format(rna_f), file=sys.stderr)
  117. reads_path = config["samples"][wildcards.sample]["f"]
  118. if not os.path.exists(reads_path):
  119. raise Exception("{} does not exist.".format(reads_path))
  120. os.symlink(reads_path, rna_f)
  121. else:
  122. print(" - A symlink already exists for {}".format(rna_f), file=sys.stderr)
  123. rule make_symlink_r:
  124. output:
  125. illumina_r = "reads/{sample}_r.fastq.gz",
  126. run:
  127. if not os.path.exists("reads"):
  128. print("Making a directory called 'reads'.", file = sys.stderr)
  129. os.makedirs("reads")
  130. else:
  131. print("The 'reads' directory exists already.", file = sys.stderr)
  132.  
  133. #make symlinks for the illumina reads
  134. print("Making read symlinks.", file =sys.stderr)
  135. for sample in config["samples"]:
  136. print(" - Checking files for sample {}".format(wildcards.sample), file=sys.stderr)
  137. rna_r = "reads/{}_r.fastq.gz".format(wildcards.sample)
  138.  
  139. if not os.path.exists(rna_r):
  140. print(" - Making a symlink for {}".format(rna_r), file=sys.stderr)
  141. reads_path = config["samples"][wildcards.sample]["r"]
  142. if not os.path.exists(reads_path):
  143. raise Exception("{} does not exist.".format(reads_path))
  144. os.symlink(reads_path, rna_r)
  145. else:
  146. print(" - A symlink already exists for {}".format(rna_r), file=sys.stderr)
  147.  
  148. #
  149. # end of rules for preprocessing
  150. #
  151. ###########################################################
  152.  
  153.  
  154. ##############################################################
  155. # _ ____ _
  156. # (_) / /_ ______ ___ (_)___ ____ _
  157. # / / / / / / / __ `__ \/ / __ \/ __ `/
  158. # / / / / /_/ / / / / / / / / / / /_/ /
  159. # /_/_/_/\__,_/_/ /_/ /_/_/_/ /_/\__,_/
  160. #
  161. # These are the rules for working with the Illumina reads.
  162.  
  163. # illumina rule 1
  164. rule trim_pairs:
  165. input:
  166. f = "reads/{sample}_f.fastq.gz",
  167. r = "reads/{sample}_r.fastq.gz",
  168. trim_jar = os.path.join(trimmomatic, "trimmomatic-0.35.jar"),
  169. adapter_path = os.path.join(trimmomatic, "adapters/TruSeq3-PE-2.fa")
  170. output:
  171. f = "trimmed/{sample}_f.trim.fastq.gz",
  172. r = "trimmed/{sample}_r.trim.fastq.gz",
  173. u1= temp("trimmed/{sample}_f.trim.unpaired.fastq.gz"),
  174. u2= temp("trimmed/{sample}_r.trim.unpaired.fastq.gz")
  175. threads:
  176. maxthreads
  177. shell:
  178. """java -jar {input.trim_jar} PE \
  179. -phred33 -threads {threads} \
  180. {input.f} {input.r} \
  181. {output.f} \
  182. {output.u1} \
  183. {output.r} \
  184. {output.u2} \
  185. ILLUMINACLIP:{input.adapter_path}:2:30:10:1:TRUE \
  186. LEADING:3 TRAILING:3 \
  187. SLIDINGWINDOW:4:15 MINLEN:36"""
  188.  
  189. # illumina rule 2
  190. rule assemble_txome:
  191. input:
  192. f_paired = "trimmed/{sample}_f.trim.fastq.gz",
  193. r_paired = "trimmed/{sample}_r.trim.fastq.gz"
  194. output:
  195. assemblypath = "txomes/raw/trinity_{sample}_raw.fasta"
  196. params:
  197. outpath = "txomes/trinity_{sample}",
  198. outfasta = "txomes/trinity_{sample}/Trinity.fasta",
  199. dockeruser = dockeruser,
  200. sslibtype = lambda wildcards: config["samples"][wildcards.sample]["SS_lib_type"]
  201. threads:
  202. maxthreads
  203. shell:
  204. """
  205. docker run \
  206. -u $(id -u):$(id -g) --rm \
  207. -v `pwd`:`pwd` \
  208. -v /etc/passwd:/etc/passwd \
  209. trinity_bowtie2.3.4.1 Trinity \
  210. --seqType fq \
  211. --left `pwd`/{input.f_paired} \
  212. --right `pwd`/{input.r_paired} \
  213. --max_memory 100G \
  214. --CPU {threads} \
  215. --trimmomatic \
  216. {params.sslibtype} \
  217. --output `pwd`/{params.outpath};
  218. mv {params.outfasta} {output.assemblypath}
  219. rm -rf {params.outpath}
  220. """
  221.  
  222. # illumina rule 3
  223. rule correct_txome_names:
  224. input:
  225. assem = "txomes/raw/trinity_{sample}_raw.fasta"
  226. output:
  227. fassem = temp("txomes/singleline/singleline_trinity_{sample}.fasta")
  228. params:
  229. samplename = "{sample}"
  230. shell:
  231. """
  232. sed 's/^>TRINITY/>{params.samplename}/' {input.assem} > {output.fassem}
  233. """
  234.  
  235. # illumina rule 4
  236. rule illumina_txome_single_line_to_multiline:
  237. """
  238. This turns the single line output of Trinity into a multi-line fasta
  239. file that can be indexed and used in something like bwa.
  240. """
  241. input:
  242. fassem = "txomes/singleline/singleline_trinity_{sample}.fasta"
  243. output:
  244. assem = "txomes/final/{sample}.fasta"
  245. run:
  246. singleline_to_multiline(input.fassem, output.assem)
  247.  
  248. # illumina rule 5
  249. rule translate_txome:
  250. input:
  251. txome = "txomes/final/{sample}.fasta"
  252. output:
  253. outpeps = temp("{sample}.fasta.transdecoder_dir/longest_orfs.pep")
  254. shell:
  255. """
  256. TransDecoder.LongOrfs -t {input.txome}
  257. """
  258. # illumina rule 5.1
  259. rule trim_transdecoder_names:
  260. """
  261. This trims transdecoder names from an extended string like:
  262. >CHA_Caecosagitta_macrocephala_DS244_DN57546_c0_g1_i1.p1 type:internal len:122 gc:universal CHA_Caecosagitta_macrocephala_DS244_DN57546_c0_g1_i1:1-363(+)
  263. to:
  264. >CHA_Caecosagitta_macrocephala_DS244_DN57546_c0_g1_i1.p1
  265. """
  266. input:
  267. pepfile = "{sample}.fasta.transdecoder_dir/longest_orfs.pep"
  268. output:
  269. renamed = temp("pepfiles/temp/{sample}_longest_orfs_renamed.pep")
  270. shell:
  271. """
  272. bioawk -cfastx '{{printf(">%s\\n%s\\n", $name, $seq)}}' {input.pepfile} > {output.renamed}
  273. """
  274.  
  275. # illumina rule 6
  276. rule move_and_multiline_peps:
  277. """
  278. This moves the translated txome to its final resting place and
  279. turns it from singleline to multiline.
  280. """
  281. input:
  282. pepfile = "pepfiles/temp/{sample}_longest_orfs_renamed.pep"
  283. output:
  284. pepfinal = "pepfiles/final/{sample}.pep"
  285. params:
  286. rmdir = lambda wildcards: "{}.fasta.transdecoder_dir".format(wildcards.sample),
  287. checkpoints = lambda wildcards: "{}.fasta.transdecoder_dir.__checkpoints_longorfs".format(wildcards.sample)
  288. run:
  289. singleline_to_multiline(input.pepfile, output.pepfinal)
  290. if os.path.exists(params.rmdir):
  291. shutil.rmtree(params.rmdir)
  292. if os.path.exists(params.checkpoints):
  293. shutil.rmtree(params.checkpoints)
  294.  
  295. # illumina rule 7 fasta softlink to db
  296. rule softlink_fasta_data:
  297. input:
  298. assem = "txomes/final/{sample}.fasta"
  299. output:
  300. outlink = "/data/ncbi/db/{sample}.fasta"
  301. params:
  302. absln = lambda wildcards: "{}/txomes/final/{}.fasta".format(curr_dir, wildcards.sample)
  303. shell:
  304. """
  305. ln -s {params.absln} {output.outlink}
  306. """
  307.  
  308. # illumina rule 8 pep softlink to db
  309. rule softlink_pep_data:
  310. input:
  311. pep = "pepfiles/final/{sample}.pep"
  312. output:
  313. outlink = "/data/ncbi/db/{sample}.pep"
  314. params:
  315. absln = lambda wildcards: "{}/pepfiles/final/{}.pep".format(curr_dir, wildcards.sample)
  316. shell:
  317. """
  318. ln -s {params.absln} {output.outlink}
  319. """
  320.  
  321. # illumina rule 9
  322. rule nucl_db_data:
  323. input:
  324. inp = "/data/ncbi/db/{sample}.fasta"
  325. output:
  326. out = "/data/ncbi/db/{sample}.fasta.nhr"
  327. shell:
  328. """
  329. makeblastdb -in {input.inp} -input_type fasta -dbtype nucl -parse_seqids
  330. """
  331.  
  332. # illumina rule 10
  333. rule prot_db_data:
  334. input:
  335. inp = "/data/ncbi/db/{sample}.pep"
  336. output:
  337. out = "/data/ncbi/db/{sample}.pep.phr"
  338. shell:
  339. """
  340. makeblastdb -in {input.inp} -input_type fasta -dbtype prot -parse_seqids
  341. """
  342.  
  343. # ILLUMINA rule 11
  344. rule diamond_data:
  345. input:
  346. pepfile="/data/ncbi/db/{sample}.pep"
  347. output:
  348. ddb = "/data/ncbi/db/{sample}.dmnd"
  349. shell:
  350. """
  351. diamond makedb --in {input.pepfile} -d {output.ddb}
  352. """
  353. # report
  354. # this section handles writing a report on all of the samples.
  355.  
  356. # Fields to acquire:
  357. # - number of reads in untrimmed
  358. # - number of reads in trimmed
  359. # - number of transcripts
  360. # - number of peps
  361.  
  362. rule number_reads_untrimmed:
  363. input:
  364. raw = "reads/{sample}_f.fastq.gz"
  365. output:
  366. raw_count = "info/counts/raw/{sample}_raw_count.txt"
  367. shell:
  368. """
  369. echo $(bioawk -cfastx 'END{{print NR}}' {input.raw}) > {output.raw_count}
  370. """
  371.  
  372. rule number_reads_trimmed:
  373. input:
  374. trimmed = "trimmed/{sample}_f.trim.fastq.gz"
  375. output:
  376. trimmed_count = "info/counts/trimmed/{sample}_trimmed_count.txt"
  377. shell:
  378. """
  379. echo $(bioawk -cfastx 'END{{print NR}}' {input.trimmed}) > {output.trimmed_count}
  380. """
  381.  
  382. rule number_transcripts:
  383. input:
  384. fasta = "txomes/final/{sample}.fasta"
  385. output:
  386. fasta_counts = "info/counts/fasta/{sample}_fasta_count.txt"
  387. shell:
  388. """
  389. echo $(bioawk -cfastx 'END{{print NR}}' {input.fasta}) > {output.fasta_counts}
  390. """
  391.  
  392. rule number_peps:
  393. input:
  394. pep = "pepfiles/final/{sample}.pep"
  395. output:
  396. pep_count = "info/counts/peps/{sample}_pep_count.txt"
  397. shell:
  398. """
  399. echo $(bioawk -cfastx 'END{{print NR}}' {input.pep}) > {output.pep_count}
  400. """
  401.  
  402. rule calcN50_tx:
  403. input:
  404. fasta = "txomes/final/{sample}.fasta"
  405. output:
  406. fasta_N50 = "info/counts/fasta/{sample}_N50.txt"
  407. shell:
  408. """
  409. bioawk -cfastx '{{print(length($seq))}}' {input.fasta} | \
  410. sort -n | \
  411. awk '{{len[i++]=$1;sum+=$1}} \
  412. END {{for (j=0;j<i+1;j++) {{csum+=len[j]; \
  413. if (csum>=sum/2) {{print len[j];break}} }} }}' > {output.fasta_N50}
  414. """
  415.  
  416. rule calcN90_tx:
  417. input:
  418. fasta = "txomes/final/{sample}.fasta"
  419. output:
  420. fasta_N90 = "info/counts/fasta/{sample}_N90.txt"
  421. shell:
  422. """
  423. bioawk -cfastx '{{print(length($seq))}}' {input.fasta} | \
  424. sort -n | \
  425. awk '{{len[i++]=$1;sum+=$1}} \
  426. END {{for (j=0;j<i+1;j++) {{csum+=len[j]; \
  427. if (csum>=(sum*0.9)) {{print len[j];break}} }} }}' > {output.fasta_N90}
  428. """
  429.  
  430. rule calcN50_pep:
  431. input:
  432. pep = "pepfiles/final/{sample}.pep"
  433. output:
  434. pep_N50 = "info/counts/peps/{sample}_N50.txt"
  435. shell:
  436. """
  437. bioawk -cfastx '{{print(length($seq))}}' {input.pep} | \
  438. sort -n | \
  439. awk '{{len[i++]=$1;sum+=$1}} \
  440. END {{for (j=0;j<i+1;j++) {{csum+=len[j]; \
  441. if (csum>=sum/2) {{print len[j];break}} }} }}' > {output.pep_N50}
  442. """
  443.  
  444. rule quality_rejects:
  445. input:
  446. fasta = "txomes/final/{sample}.fasta"
  447. output:
  448. q_rejects = "info/trimming/txome/{sample}_qual_rejects.txt"
  449. shell:
  450. """
  451. echo "0" > {output.q_rejects}
  452. """
  453.  
  454. rule adapter_rejects:
  455. input:
  456. fasta = "txomes/final/{sample}.fasta"
  457. output:
  458. a_rejects = "info/trimming/txome/{sample}_adapter_rejects.txt"
  459. shell:
  460. """
  461. echo "0" > {output.a_rejects}
  462. """
  463.  
  464. rule GC_rejects:
  465. input:
  466. fasta = "txomes/final/{sample}.fasta"
  467. output:
  468. g_rejects = "info/trimming/txome/{sample}_gc_rejects.txt"
  469. shell:
  470. """
  471. echo "0" > {output.g_rejects}
  472. """
  473.  
  474. rule calcmean:
  475. input:
  476. fasta = "txomes/final/{sample}.fasta"
  477. output:
  478. fasta_meanlen = "info/counts/fasta/{sample}_meanlen.txt"
  479. shell:
  480. """
  481. bioawk -cfastx '{{sum += length($seq)}} \
  482. END{{printf("%.2f", sum/NR)}}' {input.fasta} > {output.fasta_meanlen}
  483. """
  484.  
  485. rule calcMB:
  486. input:
  487. fasta = "txomes/final/{sample}.fasta"
  488. output:
  489. fasta_numMB = "info/counts/fasta/{sample}_mb.txt"
  490. shell:
  491. """
  492. bioawk -cfastx '{{sum += length($seq)}} \
  493. END{{printf("%.2f", sum/1000000)}}' {input.fasta} > {output.fasta_numMB}
  494. """
  495.  
  496.  
  497.  
  498. rule collate_report:
  499. """ this method prints out the final qc report of all the libraries."""
  500. input:
  501. raw_num = expand("info/counts/raw/{sample}_raw_count.txt", sample = config["samples"]),
  502. qual_reject = expand("info/trimming/txome/{sample}_qual_rejects.txt", sample = config["samples"]),
  503. adap_reject = expand("info/trimming/txome/{sample}_adapter_rejects.txt", sample = config["samples"]),
  504. gc_reject = expand("info/trimming/txome/{sample}_gc_rejects.txt", sample = config["samples"]),
  505. trim_num = expand("info/counts/trimmed/{sample}_trimmed_count.txt", sample = config["samples"]),
  506. txome_count = expand("info/counts/fasta/{sample}_fasta_count.txt", sample = config["samples"]),
  507. pep_count = expand("info/counts/peps/{sample}_pep_count.txt", sample = config["samples"]),
  508. txome_N50 = expand("info/counts/fasta/{sample}_N50.txt", sample = config["samples"]),
  509. pep_N50 = expand("info/counts/peps/{sample}_N50.txt", sample = config["samples"]),
  510. tx_meanlen = expand("info/counts/fasta/{sample}_meanlen.txt", sample = config["samples"]),
  511. tx_N90 = expand("info/counts/fasta/{sample}_N90.txt", sample = config["samples"]),
  512. tx_MB = expand("info/counts/fasta/{sample}_mb.txt", sample = config["samples"]),
  513.  
  514. output:
  515. "report/final_report.txt"
  516. run:
  517. finalout_handle = open(output[0], "w")
  518. #print("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}".format(
  519. print("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}".format(
  520. "sample",
  521. "trim_efficiency",
  522. "num_reads",
  523. "num_reads_trimmed",
  524. "quality_rejects",
  525. "adapter_rejects",
  526. "gc_rejects",
  527. "transcripts_count",
  528. "transcripts_meanlen",
  529. "transcripts_N50",
  530. "transcripts_N90",
  531. "transcripts_MB",
  532. "peps_count",
  533. "peps_N50"),
  534. file = finalout_handle)
  535. for thiss in sorted(config["samples"]):
  536. raw_num = read_number_from_file("info/counts/raw/{}_raw_count.txt".format(thiss))
  537. trim_num = read_number_from_file("info/counts/trimmed/{}_trimmed_count.txt".format(thiss))
  538. txome_count = read_number_from_file("info/counts/fasta/{}_fasta_count.txt".format(thiss))
  539. pep_count = read_number_from_file("info/counts/peps/{}_pep_count.txt".format(thiss))
  540. txome_N50 = read_number_from_file("info/counts/fasta/{}_N50.txt".format(thiss))
  541. pep_N50 = read_number_from_file("info/counts/peps/{}_N50.txt".format(thiss))
  542. qual_reject = read_number_from_file("info/trimming/txome/{}_qual_rejects.txt".format(thiss))
  543. adap_reject = read_number_from_file("info/trimming/txome/{}_adapter_rejects.txt".format(thiss))
  544. gc_reject = read_number_from_file("info/trimming/txome/{}_gc_rejects.txt".format(thiss))
  545. tx_meanlen = read_number_from_file("info/counts/fasta/{}_meanlen.txt".format(thiss))
  546. txome_N90 = read_number_from_file("info/counts/fasta/{}_N90.txt".format(thiss))
  547. txome_MB = read_number_from_file("info/counts/fasta/{}_mb.txt".format(thiss))
  548. print("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}".format(
  549. thiss,
  550. int(trim_num)/int(raw_num),
  551. raw_num,
  552. trim_num,
  553. qual_reject,
  554. adap_reject,
  555. gc_reject,
  556. txome_count,
  557. tx_meanlen,
  558. txome_N50,
  559. txome_N90,
  560. txome_MB,
  561. pep_count,
  562. pep_N50
  563. ), file = finalout_handle)
  564. finalout_handle.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement