Commit 98a2bfc1 authored by Mathieu Courcelles's avatar Mathieu Courcelles

Adds support for 15N in spectrum viewer

parent 75c66d2c
......@@ -57,16 +57,30 @@ def alive(request):
return HttpResponse(status=204)
def format_peptide_seq_with_mod(peptide):
def format_peptide_seq_with_mod(peptide, _15n=False):
"""
Formats peptide sequence string with modification for spectrum viewer.
:param peptide: Peptide object
:param _15n: Peptide is 15N labelled
:return: Peptide sequence string with modification symbols.
"""
for modification, symbol in modification_name_symbol.items():
peptide = peptide.replace(modification, symbol)
if _15n:
tmp = list()
for char in peptide:
tmp += char
if char == char.upper():
tmp += '15'
peptide = ''.join(tmp)
return peptide
......@@ -110,11 +124,20 @@ def clpeptide_msms(request, pk):
if clpeptide.validated == '':
clpeptide.validated = None
pep1_15n = False
pep2_15n = False
if clpeptide.display_protein1.startswith('15N_'):
pep1_15n = True
if clpeptide.display_protein2.startswith('15N_'):
pep2_15n = True
context = {
'myTolerance': 10,
'myPrecursorZ': clpeptide.precursor_charge,
'myPeptide': format_peptide_seq_with_mod(clpeptide.peptide1),
'myPeptide2': format_peptide_seq_with_mod(clpeptide.peptide2),
'myPeptide': format_peptide_seq_with_mod(clpeptide.peptide1, _15n=pep1_15n),
'myPeptide2': format_peptide_seq_with_mod(clpeptide.peptide2, _15n=pep2_15n),
'myPeaklist': peak_list,
'clpeptide': clpeptide,
'validation_disabled': validation_disabled,
......
......@@ -860,7 +860,7 @@ AA.prototype.vfragmentxlinkpeptide2 = function(pep_a_seq, pep_b_seq, a_link_pos,
allfrags = iparents;
if(! is2ndpep)
allfrags = [iparents[0]];
for(var i=0; i< frag1list.length; i++){
allfrags.push(frag1list[i]);
if(params.fragrounds == 2){
......@@ -921,7 +921,7 @@ AA.prototype.vfragmentxlinkpeptide2 = function(pep_a_seq, pep_b_seq, a_link_pos,
// name them!
allfrags[i] = {"type":type,"frag":frag[1],"name": frag[1], "seq": frag[0], "tok":[], "mask":[], "lost":[], "lostform":[]};
}
// calculate the loss combinations for each fragment... we might try to limit this to 2!
/*
losses table format:
......
......@@ -414,7 +414,26 @@ Z {{ linked_formula }}
dss C8H12O3
me CH2
dme C2H4
G15 15NH2CH2COOH -H2 -O
A15 15NCH3CHH2COOH -H2 -O
S15 15NHOCH2CHH2COOH -H2 -O
P15 15NHCH2CH2CH2CHCOOH -H2 -O
V15 15NCH3CH3CHCHH2COOH -H2 -O
T15 15NCH3CHOHCHH2COOH -H2 -O
C15 15NHSCH2CHH2COOH -H2 -O
I15 15NCH3CH2CHCH3CHH2COOH -H2 -O
L15 15NCH3CH3CHCH2CHH2COOH -H2 -O
N15 15N2H2COCH2CHH2COOH -H2 -O
D15 15NHOOCCH2CHH2COOH -H2 -O
Q15 15N2H2COCH2CH2CHH2COOH -H2 -O
K15 15N2H2CH2CH2CH2CH2CHH2COOH -H2 -O
E15 15NHOOCCH2CH2CHH2COOH -H2 -O
M15 15NCH3SCH2CH2CHH2COOH -H2 -O
H15 15N3HCHCHCCH2CHH2COOH -H2 -O
F15 15NC6H5CH2CHH2COOH -H2 -O
R15 15N4HCH2HCH2CH2CH2CHH2COOH -H2 -O
Y15 15NHOC6H4CH2CHH2COOH -H2 -O
W15 15N2C6H5HCHCCH2CHH2COOH -H2 -O
</textarea></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment