Example #1
0
 public static RelationFile run(
     String fasta, es.ehubio.proteomics.pipeline.Digester.Config digestion, int minPep, int maxPep)
     throws IOException, InvalidSequenceException {
   RelationFile relations = new RelationFile("protein", "peptideSequence");
   for (Fasta protein : Fasta.readEntries(fasta, SequenceType.PROTEIN)) {
     for (String pepSeq :
         es.ehubio.proteomics.pipeline.Digester.digestSequence(protein.getSequence(), digestion)) {
       if (pepSeq.length() < minPep || pepSeq.length() > maxPep) continue;
       relations.addEntry(new Relation(protein.getAccession(), pepSeq));
     }
   }
   return relations;
 }
Example #2
0
 @Override
 protected void run(List<Argument> args) throws Exception {
   Enzyme enzyme = Enzyme.valueOf(getValue(Arguments.OPT_ENZYME));
   int missedCleavages = getIntValue(Arguments.OPT_CLEAVAGES);
   boolean usingDP = getBooleanValue(Arguments.OPT_ASP_PRO);
   int cutNterm = getIntValue(Arguments.OPT_CUT_NTERM);
   es.ehubio.proteomics.pipeline.Digester.Config digestion =
       new es.ehubio.proteomics.pipeline.Digester.Config(
           enzyme, missedCleavages, usingDP, cutNterm);
   RelationFile relations =
       run(
           getValue(OPT_FASTA),
           digestion,
           getIntValue(Arguments.OPT_MIN_PEP_LEN),
           getIntValue(Arguments.OPT_MAX_PEP_LEN));
   relations.save(getValue(OPT_REL));
 }