Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semi-specific digestion in the IteratorFactory #64

Open
wenbostar opened this issue Apr 29, 2024 · 6 comments
Open

Semi-specific digestion in the IteratorFactory #64

wenbostar opened this issue Apr 29, 2024 · 6 comments
Assignees

Comments

@wenbostar
Copy link

Is there a way to do semi-tryptic digestion using the getSequenceIterator function from IteratorFactory?

@hbarsnes hbarsnes self-assigned this Apr 30, 2024
@hbarsnes
Copy link
Member

Yes, I think you should be able to do something like this:

DigestionParameters digestionPreferences = new DigestionParameters();
digestionPreferences.setCleavageParameter(DigestionParameters.CleavageParameter.enzyme);
digestionPreferences.addEnzyme(enzymeFactory.getEnzyme("Trypsin"));
SequenceIterator sequenceIterator = iteratorFactoryNoModifications.getSequenceIterator(yourSequence, digestionPreferences, 0.0, Double.MAX_VALUE);

@wenbostar
Copy link
Author

Hi @hbarsnes , thanks. Which parameter in the code is used to control for semi-digestion?

@hbarsnes
Copy link
Member

Ah, sorry, forgot to add the semi-specific part. See the fourth line below.

DigestionParameters digestionPreferences = new DigestionParameters();
digestionPreferences.setCleavageParameter(DigestionParameters.CleavageParameter.enzyme);
digestionPreferences.addEnzyme(enzymeFactory.getEnzyme("Trypsin"));
digestionPreferences.setSpecificity("Trypsin", Specificity.semiSpecific);
SequenceIterator sequenceIterator = iteratorFactoryNoModifications.getSequenceIterator(yourSequence, digestionPreferences, 0.0, Double.MAX_VALUE);

@wenbostar
Copy link
Author

It looks like this doesn't work.

void testSemi_digestion(){
        IteratorFactory iteratorModifications = new IteratorFactory(new ArrayList<>());
        DigestionParameters digestionPreferences = new DigestionParameters();
        digestionPreferences.setCleavageParameter(DigestionParameters.CleavageParameter.enzyme);
        digestionPreferences.addEnzyme(EnzymeFactory.getInstance().getEnzyme("Trypsin"));
        digestionPreferences.setSpecificity("Trypsin", DigestionParameters.Specificity.semiSpecific);

        try {
            SequenceIterator sequenceIterator = iteratorModifications.getSequenceIterator("MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYR", digestionPreferences, 0.0, Double.MAX_VALUE);
            ExtendedPeptide extendedPeptide;
            while (true) {
                try {
                    if ((extendedPeptide = sequenceIterator.getNextPeptide()) == null) {
                        break;
                    }

                    Peptide peptide = extendedPeptide.peptide;
                    System.out.println(peptide.getSequence());

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }



            }
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

Output:

MTEYK
LVVVGAGGVGK
SALTIQLIQNHFVDEYDPTIEDSYR

Utilities version: 5.0.39.

@wenbostar
Copy link
Author

@hbarsnes
Copy link
Member

Seems like you are correct in that the support for semi-specific has not been implemented for the IteratorFactory. I'll add it to the list of requested features, but I'm afraid that we will not have the resources to look into it at the moment.

@hbarsnes hbarsnes changed the title Semi-specific digestion Semi-specific digestion in the IteratorFactory Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants