def mappingSaklCleanSE(strain):
    reads1 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanPE/s_1_%s-trim.fq" % (strain)
    reads2 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanPE/s_2_%s-trim.fq" % (strain)

    if not os.path.isfile(reads1):
        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/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 reads1:
        opt += "-I "
    # print reads

    ficSam = traitementBWA.lanceBWA(outBWA, reads1, reads2, repOut, ref, opt)
    # conversion du ficSam traditionnel en ficSam avec Flags textuels
    ficSamInRef = traitementSamtools.deconvolueSam(ficSam)
    ficSamNotInRef = ficSamInRef.replace("inRef", "notInRef")
    ficSamX = traitementSamtools.convertFlag(ficSamNotInRef)
    traitementBWA.extraitPEUnmappedReads(ficSamX, reads1, reads2)
def extraitUnmappedCleanSE(strain):
    reads1 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanPE/s_1_%s-trim.fq" % (strain)
    reads2 = "/Volumes/BioSan/Users/friedrich/GB-3G/Reads/CleanPE/s_2_%s-trim.fq" % (strain)

    if not os.path.isfile(reads1):
        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/NuclearMito/%s" % (strain)
    ficSamInRef = "%s/aln_%sPE.sam.inRef" % (repOut, strain)
    ficSamNotInRef = ficSamInRef.replace("inRef", "notInRef")
    ficSamX = traitementSamtools.convertFlag(ficSamNotInRef)
    traitementBWA.extraitPEUnmappedReads(ficSamX, reads1, reads2)