示例#1
0
def pipeSakl(strain):
    reads1 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/Run3/CleanPE/s_1_%s-trim.fq" % (strain)
    reads2 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/Run3/CleanPE/s_2_%s-trim.fq" % (strain)
    repOut = "/Volumes/BioSan/Users/friedrich/GB-3G/BWA/Nuclear/CleanPE/%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_1Bis" % strain
    opt = ""
    if not "Run3" in reads1:
        opt += "-I"
    ficSam = traitementBWA.lanceBWA(outBWA, reads1, reads2, repOut, ref, opt)

    #ficSam = "%s/%sPE.sam" % (repOut,outBWA)
    # conversion du ficSam traditionnel en ficSam avec Flags textuels
    ficSamX = traitementSamtools.convertFlag(ficSam)
    #ficSamX = "%s-X" % ficSam
    # extraction des ali de reads paires de ficSam a partir des infos de ficSamX
    ficSamCorrect = traitementBWA.extraitCorrectlyPairedFromSam(ficSamX, ficSam)

    #ficSamCorrect = "%s/aln_%s_1BisPE.sam-correct" % (repOut,strain)
    lUnmappedReads = traitementBWA.extraitUnmappedReadsPair(ficSamCorrect, reads1, reads2)
    opt += " -n 8 -o 2"

    outBWA2 = "aln_%s_unmapped" % strain
    ficSamUnmapped = traitementBWA.lanceBWA(outBWA2, lUnmappedReads[0], lUnmappedReads[1], repOut, ref, opt)
    #ficSamUnmapped = "%s/aln_%s_unmappedPE.sam" % (repOut,strain)
    ficSamUnmappedInRef = traitementSamtools.deconvolueSam(ficSamUnmapped)
    # concatenation des 2 fichiers sam : d abord les unmapped pour avoir le header, puis ficSamCorrected
    ficSamAll = "%s/aln_%s_PE.sam" % (repOut, strain)

    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])

    #traitementSamtools.lancePipeSamtools(ficSamAll,ref)
    # 1ere etape est de retirer les ali avec flag ? a 0 dans les bam

    ficVarFilter = traitementSamtools.lancePipeSamtools(ficSamAll, ref)
    traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)
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)
示例#3
0
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)
示例#4
0
def pipeSace(strain):
	
	reads1 = "/Volumes/BioSan/Users/ssiguenza/Projets/MiSeqDunham/RunOct2012/%s/CleanPE/s_1_%s-trim-clean.fq" % (strain,strain)
	reads2 = "/Volumes/BioSan/Users/ssiguenza/Projets/MiSeqDunham/RunOct2012/%s/CleanPE/s_2_%s-trim-clean.fq" % (strain,strain)
	
	repOut = "/Volumes/BioSan/Users/friedrich/NIH/RunOct2012/%s/n9o2" % 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)
	
	outBWA = "aln_%s" % strain
	opt = "-n 9 -o 2"
	#opt += " -I"
	ficSamAll = traitementBWA.lanceBWA(outBWA,reads1,reads2,repOut,ref,opt)
	ficSamAll = "%s/aln_%sPE.sam" % (repOut,strain)
	ficVarFilter = traitementSamtools.lancePipeSamtools(ficSamAll,ref)
	traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)
示例#5
0
def pipeSaklEnd(strain):
	repOut = "/Volumes/BioSan/Users/friedrich/GB-3G/BWA/Nuclear/RawPE/%s" % strain
	ref = "/Volumes/BioSan/Users/friedrich/GB-3G/SequenceReference/Sakl/Index/BWA/saklRef.fasta"
	lUnmappedReads = list()
	lUnmappedReads.append("/Volumes/BioSan/Users/friedrich/GB-3G/Reads/Run3/s_1_%s_unmapped.fq" % strain)
	lUnmappedReads.append("/Volumes/BioSan/Users/friedrich/GB-3G/Reads/Run3/s_2_%s_unmapped.fq" % strain)
	ficSamCorrect = "%s/aln_%s_1BisPEBis.sam-correct" % (repOut,strain) 
	ficSamUnmappedInRef = "%s/aln_%s_unmappedPEBis.sam.inRef" % (repOut,strain) 
	ficSamAll = "%s/aln_%s_PEBis.sam" % (repOut,strain)
	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])
	
	#traitementSamtools.lancePipeSamtools(ficSamAll,ref)
	# 1ere etape est de retirer les ali avec flag ? a 0 dans les bam

	ficVarFilter = traitementSamtools.lancePipeSamtools(ficSamAll,ref) 
	traitementSamtools.fromVarfilter2tsvLike(ficVarFilter)