Commit 24f076cf authored by Laure QUINTRIC's avatar Laure QUINTRIC
Browse files

handle R1R2 and genoscope files

parent 807a3f89
......@@ -5,8 +5,8 @@
Extract and organize forward and reverse reads from ligation sequencing data
For Sample :
* R1 : sample-R1.fastq.gz
* R2 : sample-R2.fastq.gz
* R1 : sample_R1.fastq.gz or sample_X_1_X.fastq.gz
* R2 : sample_R2.fastq.gz or sample_X_2_X.fastq.gz
4 files will be generated :
* R1F : sample_R1F.fastq.gz for forward reads extracted from file R1
......
......@@ -96,7 +96,7 @@ if __name__ == '__main__':
if patternGenoscope.match(rf):
if '_1_1_' in str(rf):
R2 = rf.replace('_1_1_', '_1_2_')
else :
elif '_1_' in str(rf) :
R2 = rf.replace('_1_', '_2_')
else :
logger.debug("No pair found for sample {}, exiting program...".format(R1))
......@@ -128,7 +128,7 @@ if __name__ == '__main__':
logger.debug("job number : {}".format(out))
#check if number of generated files is ok
cmd="qsub -o {}/logs -V -W depend=afterok:{} {}/check.pbs".format(output,":".join(jobs), directory)
cmd="qsub -o {}/logs -V -W depend=afterok:{} {}/check.pbs".format(output,":".join(jobs), directory)
check = runcmd(cmd).strip().split(".")[0]
else :
logging.debug("No fastq.gz files found in {}, exiting program".format(indir))
......
......@@ -96,7 +96,10 @@ def extractReads(inR1, inR2, outdir, forward, reverse, mismatch, tmpdir, trimrea
R1R = "R1R"
R2R = "R2R"
R2F = "R2F"
couplename="{}".format(inR1.split("/")[-1].split(".fastq.gz")[0])
if "_R1" in inR1 :
couplename="{}".format(inR1.split("/")[-1].split(".fastq.gz")[0].replace("_R1", ""))
else :
couplename="{}".format(inR1.split("/")[-1].split(".fastq.gz")[0].replace("_1", ""))
logging.debug("Couple name : {}".format(couplename))
samplename="{}_{}".format(couplename, R1F)
......
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