def pipeIncompForAssembly(strain,out): reads = "/Volumes/BioSan/Users/friedrich/Incompatibilite/Reads/%s/NG-5435_%s_sequence.fastq" % (strain,strain[:-2]) repOut = "/Volumes/BioSan/Users/friedrich/Incompatibilite/BWA/%s" % strain ref = "/Volumes/BioSan/Users/friedrich/Incompatibilite/ReferenceSequence/FY/Index/BWA/FYref.tfa" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) opt = "-n 0 -o 0" ficSam = traitementBWA.lanceBWAsamse(strain,out,reads,repOut,ref,opt) ficSamX = traitementSamtools.convertFlag(ficSam) lUnmappedReads = traitementBWA.extraitUnmappedReads(ficSam,reads)
def pipeIncomp16(strain,out): reads = "/Volumes/BioSan/Users/friedrich/Incompatibilite/Reads/%s/NG-5435_%s_sequence.fastq" % (strain,strain[:-2]) repOut = "/Volumes/BioSan/Users/friedrich/Incompatibilite/BWA/Chrom16/%s" % strain ref = "/Volumes/BioSan/Users/friedrich/Incompatibilite/ReferenceSequence/FY/Index/BWA/chrom16_350000-420000.fasta" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) ficSam = traitementBWA.lanceBWAsamse(strain,out,reads,repOut,ref) ficSam = "%s/%sSE.sam" % (repOut,out) ficSamInRef = traitementSamtools.deconvolueSam(ficSam) # 1ere etape est de retirer les ali avec flag ? a 0 dans les bam ficVarFilter = traitementSamtools.lancePipeSamtools(ficSamInRef,ref) traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)
def pipeCramORI(): reads1 = "/Volumes/BioSan/Users/friedrich/Dikaryome/Reads/Cram/CleanPE/AQF_AFOSU_4_all_707WBAAXX-trim.fq" #reads2 = "/Volumes/BioSan/Users/friedrich/Dikaryome/Reads/Cram/CleanPE/AQF_AFOSU_4_2_707WBAAXX-trim.fq" repOut = "/Volumes/BioSan/Users/friedrich/Dikaryome/BWA/CramVsDeha" ref = "/Volumes/BioSan/Users/friedrich/Dikaryome/ReferenceSequences/Deha/Index/BWA/genomeDeha.tfa" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) outBWA = "aln_CramVsDeha" opt = "-n 8 -o 2" ficSam = traitementBWA.lanceBWAsamse(outBWA,reads1,repOut,ref,opt) #ficSam = "aln_CramVsDeha_1SE.sam" # determination des unmapped reads #lUnmappedReads = traitementBWA.extraitUnmappedReadsPair(ficSamCorrect,reads1,reads2) # mapping de ces "unmapped" avec des parametres moins stringents #outBWA2 = "aln_CramVsDeha_unmapped" #ficSamUnmapped = traitementBWA.lanceBWA(outBWA2,lUnmappedReads[0],lUnmappedReads[1],repOut,ref,opt) #ficSamUnmappedInRef = traitementSamtools.deconvolueSam(ficSamUnmapped) # concatenation des 2 fichiers sam : d abord les unmapped pour avoir le header, puis ficSamCorrected #ficSamAll = "%s/aln_CramVsDeha_PE.sam" % (repOut) #cmdB = "cat %s %s > %s" % (ficSamUnmappedInRef,ficSamCorrect,ficSamAll) # a partir de celui-ci extraction des ali des paires OK #os.system(cmdB) # je peux creer les fic de reads unmapped pour mito a partir de la aussi # ils s appelleront xxx_unmapped_unmapped.fq #lReadsUnmappedPourMito = traitementBWA.extraitUnmappedReadsPair(ficSamUnmappedInRef,lUnmappedReads[0],lUnmappedReads[1]) ficVarFilter = traitementSamtools.lancePipeSamtoolsSansRel(ficSam,ref) # 1ere etape est de retirer les ali avec flag ? a 0 dans les bam traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)
def pipeIncompSE(strain): reads = "/Volumes/BioSan/Users/friedrich/Incompatibilite/Reads/Run5/s_%s_all-trim.fq" % (strain) repOut = "/Volumes/BioSan/Users/friedrich/Incompatibilite/BWA/%s" % strain ref = "/Volumes/BioSan/Users/friedrich/Incompatibilite/ReferenceSequence/FY/test_ref/FYref.fasta" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) opt = "-n 5 -o 1" opt = "" out = "aln-%s" % strain ficSam = traitementBWA.lanceBWAsamse(out,reads,repOut,ref,opt) #ficSam = "%s/%sSE.sam" % (repOut,out) ficSamInRef = traitementSamtools.deconvolueSam(ficSam) #ficSamInRef = "%s/%sSE.sam.inRef" % (repOut,out) # 1ere etape est de retirer les ali avec flag ? a 0 dans les bam ficVarFilter = lancePipeSamtoolsJing(ficSamInRef,ref) traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)
def pipeMDR(strain): #reads = "/Volumes/BioSan/Users/friedrich/MDR/Reads/Run5/s_%s-trim.fq" % (strain) #reads = "/Volumes/BioSan/Users/friedrich/MDR/Reads/Run5c/CleanSE/s_%s-trim.fq" % (strain) reads = "/Volumes/BioSan/Users/friedrich/Incompatibilite/Reads/YJM326_1/NG-5435_YJM326_sequence.fastq-trim.fastq" #repOut = "/Volumes/BioSan/Users/friedrich/MDR/BWA/%s" % strain repOut = "/Volumes/BioSan/Users/friedrich/Incompatibilite/Reads/YJM326_1" ref = "/Volumes/BioSan/Users/friedrich/Incompatibilite/ReferenceSequence/FY/Index/BWA/FYref.tfa" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) opt = "-n 5 -o 1" #opt = "-n 0 -o 0" out = "alnFin-%s" % strain ficSam = traitementBWA.lanceBWAsamse(out, reads, repOut, ref, opt) ficSamInRef = traitementSamtools.deconvolueSam(ficSam) # 1ere etape est de retirer les ali avec flag ? a 0 dans les bam ficVarFilter = traitementSamtools.lancePipeSamtools(ficSamInRef, ref) fromVarfilter2tsvLikeCyrielle(ficVarFilter)
def pipeSaklSE(strain, p1, p2): reads = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/Run5/s_%s_all-trim.fq" % (strain) repOut = "/Volumes/BioSan/Users/pjung/Documents/GB-3G/BWA/Nuclear/Recombinaison/%s" % strain ref = "/Volumes/BioSan/Users/friedrich/GB-3G/SequenceReference/Sakl/Index/BWA/saklRef.fasta" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) outBWA = "aln_%s" % strain opt = "" if not "Run3" in reads and not "Run4" in reads and not "Run5" in reads: opt += "-I" opt += " -n 5 -o 1" ficSam = traitementBWA.lanceBWAsamse(outBWA, reads, repOut, ref, opt) ficVarFilter = traitementSamtools.lancePipeSamtoolsRecomb(ficSam, ref) ficOri = definiProvenanceSeg(strain, p1, p2) #ficOri = "ori81b.tab" ficOriNew = postTraiteProvenanceSeg(ficOri, strain)
def mappingSaklCleanSEOld(strain): reads = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanSE30strains/s_%s-trim.fq" % (strain) if not os.path.isfile(reads): reads = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanSE30strains/Run3/s_%s-trim.fq" % (strain) repOut = "/Volumes/BioSan/Users/friedrich/GB-3G/BWA/NuclearMito/%s" % (strain) ref = "/Volumes/BioSan/Users/friedrich/GB-3G/SequenceReference/Sakl/Index/BWA/saklRefNuclMito.fasta" if not os.path.isdir(repOut): os.mkdir(repOut) cmdA = "chmod 777 %s" % repOut os.system(cmdA) outBWA = "aln_%s" % strain opt = "-n 8 -o 2 " if not "Run3" in reads: opt += "-I " print reads ficSam = traitementBWA.lanceBWAsamse(outBWA, reads, repOut, ref, opt) # ficSam = "/Volumes/BioSan/Users/friedrich/GB-3G/BWA/NuclearMito/55-86_1/aln_55-86_1SE.sam" ficSamInRef = traitementSamtools.deconvolueSam(ficSam) ficSamX = traitementSamtools.convertFlag(ficSamInRef) unmappedReads = traitementBWA.extraitUnmappedReads(ficSamX, reads)