Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

src/m/g/mgtaxa-HEAD/MGT/FastaIO.py   mgtaxa(Download)
def shredFasta(inpFasta,outFasta,fragSize,fragCountRatio=1.,lineLen=80,outMode="w"):
    """Shred each record in multi-FASTA file into multiple records of fixed size"""
    from MGT.FeatIO import LoadSeqPreprocShred
    inpSeq = FastaReader(inpFasta)
    outSeq = FastaWriter(out=outFasta,lineLen=lineLen,mode=outMode)
    if fragCountRatio < 1.:
        sampNum = lambda lab,seq,id: int(len(seq)/(fragSize/2)*fragCountRatio) 
    else:
        sampNum = 0
    shredder = LoadSeqPreprocShred(sampLen=fragSize,sampNum=sampNum,
        id = rec.getId()
        seq = rec.sequence()
        labFr,seqFr,idFr = shredder(0,seq,id)
        startsFr = shredder.getLastSampStarts()
        for iF,sF in enumerate(seqFr):

src/m/g/mgtaxa-HEAD/MGT/ImmClassifierBench.py   mgtaxa(Download)
    def shredFasta(self,idDb,fragLen,
            fragCountMax,lineLen=80,outMode="w"):
        """Shred each record in multi-FASTA file into multiple records of fixed size"""
        ##@todo See if we can avoid saving empty files (for very short input records)
        from MGT.FeatIO import LoadSeqPreprocShred
        inpSeq = seqDb.fastaReader(idDb)
        outSeq = self.fastaWriterUncompr(idDb,lineLen=lineLen,mode=outMode)
        shredder = LoadSeqPreprocShred(sampLen=fragLen,
                sampNum=sampNum,
                makeUniqueId=False,