Mercurial > repos > qfabrepo > metadegalaxy_reheader
annotate reheader.py @ 1:9cb93e3df272 draft
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit dc2fe0de7778cdaff7b35d56691ce3de7919fc79"
author | qfabrepo |
---|---|
date | Fri, 18 Sep 2020 10:05:18 +0000 |
parents | 331fd79a9341 |
children |
rev | line source |
---|---|
0
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
1 #!/usr/bin/env python |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
2 import sys |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
3 from Bio.Seq import Seq |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
4 from Bio import SeqIO |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
5 from Bio.SeqRecord import SeqRecord |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
6 from os.path import basename |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
7 import os |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
8 import re |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
9 import argparse |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
10 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
11 parser = argparse.ArgumentParser( |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
12 description="reformat the read name (header) by appending the sample name to the read name\n" + |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
13 "Example:\n python reheader.py -n F3D0_R1.fastq -i test-data/F3D0_R1.fastq -o test-data/test -l mylog -d test-data/") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
14 parser.add_argument("-v","--version",action="version",version="%(prog)s 1.0") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
15 parser.add_argument("-n","--samplename",dest="samplename",default=False,help="input sample name") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
16 parser.add_argument("-i","--input",dest="inputfile",default=False,help="input filename in FASTQ format") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
17 parser.add_argument("-l","--log", dest="logfile",default=False,help="output log file") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
18 parser.add_argument("-o","--outfile",dest="outputfile",default=False,help="output filename") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
19 parser.add_argument("-d","--outdir",dest="outputdir",default=False,help="output directory") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
20 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
21 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
22 if(len(sys.argv) == 1): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
23 parser.print_help(sys.stderr) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
24 sys.exit() |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
25 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
26 args = parser.parse_args() |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
27 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
28 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
29 filename = args.samplename |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
30 infile = args.inputfile |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
31 str_to_add = os.path.splitext(basename(filename))[0] |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
32 outfile = args.outputfile |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
33 outdir = args.outputdir |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
34 logfile = args.logfile |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
35 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
36 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
37 rdict = { |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
38 '_R1': '/1', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
39 '_R2': '/2', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
40 '_1': '/1', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
41 '_2': '/2', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
42 } |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
43 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
44 rdict_remove = { |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
45 '_R1': '', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
46 '_R2': '', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
47 '_1': '', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
48 '_2': '', |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
49 } |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
50 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
51 def makesubs(s): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
52 for pattern, repl in rdict.items(): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
53 pat1 = pattern +'_?[A-Za-z0-9]+$' |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
54 pat2 = pattern |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
55 combined_pat = r'|'.join((pat1, pat2)) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
56 s = re.sub(combined_pat, repl,s) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
57 return s |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
58 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
59 def makesubs_remove(s): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
60 for pattern, repl in rdict_remove.items(): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
61 pat1 = pattern +'_?[A-Za-z0-9]+$' |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
62 pat2 = pattern |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
63 combined_pat = r'|'.join((pat1, pat2)) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
64 s = re.sub(combined_pat, repl,s) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
65 return s |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
66 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
67 def appendStringToSequenceHeader(inputfile,header_to_add): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
68 records=[] |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
69 for seq_record in SeqIO.parse(inputfile, "fastq"): |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
70 header =seq_record.id |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
71 header = "{0}".format(header) + "_" +header_to_add |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
72 record = SeqRecord(seq_record.seq,id=header,description="") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
73 record.letter_annotations["phred_quality"]=seq_record.letter_annotations["phred_quality"] |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
74 records.append(record) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
75 return records |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
76 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
77 str_to_search = makesubs_remove(str_to_add) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
78 str_to_add = makesubs(str_to_add) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
79 final_records=[] |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
80 outlogfile=open(os.path.join(outdir,logfile),"w") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
81 |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
82 final_records=appendStringToSequenceHeader(infile,str_to_add) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
83 outlogfile.write(str_to_search) |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
84 SeqIO.write(final_records, outfile , "fastq") |
331fd79a9341
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/reheader commit 6783cd68521863b34f8e77cbb7ba404700c72313-dirty"
qfabrepo
parents:
diff
changeset
|
85 outlogfile.close() |