Commit 9b16a1a8 authored by Laure QUINTRIC's avatar Laure QUINTRIC

format data for frogs

parent c06e1ca3
......@@ -136,9 +136,9 @@ def extractReads(inR1, inR2, outdir, forward, reverse, mismatch, tmpdir, trimrea
R2repairedF= R2cutadaptoutnameF.replace("-cutadapt", "")
rePairReads(outdir, R1repairedR, R2repairedF , singletons, R1cutadaptoutnameR, R2cutadaptoutnameF)
cmd = "zcat {} {} > {} ; gzip {}".format(R1repairedF, R2repairedF, R1repairedF.replace("_R1F", "_R1"), R1repairedF.replace("_R1F", "_R1"))
cmd = "zcat {} {} > {}/frogs/{} ; gzip {}/frogs/{}".format(R1repairedF, R2repairedF, outdir, R1repairedF.replace("_R1F", "_R1"), outdir, R1repairedF.replace("_R1F", "_R1"))
out = runcmd(cmd)
cmd = "zcat {} {} > {} ; gzip {}".format(R1repairedR, R2repairedR, R1repairedR.replace("_R1R", "_R2"), R1repairedR.replace("_R1R", "_R2"))
cmd = "zcat {} {} > {}/frogs/{} ; gzip {}/frogs/{}".format(R1repairedR, R2repairedR, outdir, R1repairedR.replace("_R1R", "_R2"), outdir, R1repairedR.replace("_R1R", "_R2"))
out = runcmd(cmd)
def runCutadapt(primerseq, mismatch, outfile, samplename, infile, tmpdir, trimreads) :
......@@ -223,10 +223,11 @@ if __name__ == '__main__':
logging.debug("Primer forward {} = {}".format(barcode, forward))
logging.debug("Primer reverse {} = {}".format(barcode, reverse))
os.system("mkdir -p {}/frogs".format(outdir))
# Extract Forward and Reverse Reads according to Primers (using cutadapt)
extractReads(inR1, inR2, outdir, forward, reverse, mismatch, tmpdir, trimreads)
#create frogs archive
os.system("mkdir -p {}/frogs; cd {}; tar cvf frogs/samples.tar *_{{R1,R2}}.fastq.gz".format(outdir,outdir))
os.system("cd {}/frogs; tar cvf samples.tar *_{{R1,R2}}.fastq.gz && rm *_{{R1,R2}}.fastq.gz".format(outdir))
logging.debug("End of processing")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment