Chih-Chiang,

If you can read C++, please have a look in the following functions:

SpectraSTSpLibImporter::doGenerateShuffleAndRepositionDecoy() 
Peptide::shuffle()

This is where the shuffle-and-reposition decoy generation is implemented. 
You can see how you would like to disable this behavior. Perhaps the most 
straightforward way is to set numAAsToAdd to zero at the beginning of 
Peptide::shuffle(). Depending on your luck, you may end up in an infinite 
loop, however. You may have to fiddle with the minHomology parameter or 
increase the number of attempts to get it through. 

In the example you mentioned, I am guessing what happened is that you have 
a very noisy spectrum, and no matter what sequence it shuffles to, the 
repositioned spectrum still looks too similar to the original one. Only 
peaks that can be annotated to known ions will be repositioned; those that 
do not will stay where it is.  If you have too many large unannotated 
peaks, then the resulting decoy spectrum will still look similar to the 
original one. As an act of desperation, SpectraST adds the random AAs and 
basically put the decoy spectrum in a different precursor m/z range to 
avoid "collision" with the original spectrum. 

Actually, I would suggest that you think more carefully about what you 
need. In my mind, how you generate decoys actually matter; it is not just 
you need some decoys for Percolators to work. The decoys need to satisfy 
some criteria, or else the model predicted by Percolator will not be 
accurate or discriminating. For instance, it is important to ensure that 
the decoy spectrum is realistic but sufficiently different from the 
original. I also believe you need enough decoy spectra in your search 
space. If you can help it, it may be better to (i) use high-quality library 
spectra (e.g. consensus spectra of many replicates, not just some random 
raw spectrum that you managed to identify with one search engine), (ii) use 
a larger pool of library spectra to begin with. Instead of setting large 
precursor mass tolerance, I would suggest you just include more spectra in 
your library, even if you know that peptide is not in your sample.

Henry

Henry




On Saturday, July 21, 2018 at 12:12:05 PM UTC+8, Chih-Chiang Tsou wrote:
>
> Hi Henry,
>
> Thanks a lot. No it doesn't happen frequently, only for few cases of 
> shorter sequences and the explanation you gave was exactly what I thought 
> but was wondering if there is any way to avoid that.
>
> What I am trying to do is to do spectral library search for a very small 
> library (one or two peptide ions) against a lot of spectra with close 
> precursor mass. I am hoping to take advantage of percolator afterward so I 
> would need to have decoy hits. Having shifted mass for decoy spectra will 
> lead to zero decoy hit. Another workaround perhaps is to set very large 
> precursor mass tolerance in SpectraST search since I can control what 
> spectra to be fed into the search, then I will have decoy hits for 
> percolator modeling. Does this workaround make sense to you?
>
> Thanks,
> Chih-Chiang
>
> On Friday, July 20, 2018 at 5:52:15 PM UTC-5, Henry Lam wrote:
>>
>> Chih-Chiang,
>>
>> Yes, this is the intended behavior. This should not happen a lot, 
>> however. So if you are seeing this frequently, perhaps I need to look into 
>> it.
>>
>> The reason why it is there is to safeguard against low-complexity peptide 
>> sequences. SpectraST checks the shuffled sequence to make sure it does not 
>> look at the original one; if so, it will shuffle again. But it won't do 
>> this forever; after a certain number of rounds, it gives up and adds 
>> additional AAs to it to create more possible sequences to try. Without this 
>> escape, SpectraST will get stuck in an infinite loop. (There are peptides 
>> like AAAAAAAAAAAAAK, which is hopeless unless we add more AAs to it.)
>>
>> If you don't want SpectraST to do this, we will have to edit the code and 
>> recompile. I don't think offering such a user option is the way to go, 
>> since I think the current way is probably the least bad compromise. Are you 
>> familiar with C++? If so, I can point you to that function and you can 
>> decide what to do. Perhaps you can comment that out as a quick fix, but you 
>> will need another escape mechanism (e.g. just do not create decoys for 
>> these guys).
>>
>> Henry
>>
>> On Friday, July 20, 2018 at 5:10:29 AM UTC+8, Chih-Chiang Tsou wrote:
>>>
>>> Hi TPP developers
>>>
>>> I used SpectraST to generate decoy spectra and I noticed there are decoy 
>>> spectra generated based on shuffled sequences with AAs added randomly. Is 
>>> there option to disable it?
>>>
>>> Below is the message I got from spectrast:
>>> DECOY: Shuffle DFGLTSLALV to DSTLLGAFLVMGV. (3 AAs added randomly.) 
>>> (Shift 143.565 Th to decoy peptide's precursor m/z.)
>>>
>>> Thanks,
>>> Chih-Chiang
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"spctools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/spctools-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to