Skip to content

Commit

Permalink
add matched_missing_monoisotopic information to fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Kolbowski committed Oct 17, 2019
1 parent c424ea4 commit 3ce5cf4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
48 changes: 27 additions & 21 deletions pyxiannotator/AnnotatedSpectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def create_fragments(anno_json):
# Peak(peak['mz'], peak['intensity']) for peak in anno_json['peaks'] if
# fragment_cluster_id in peak['clusterIds']]

miss_monoiso = bool(fragment_cluster_info['matchedMissingMonoIsotopic'])

if fragment['class'] == 'lossy':
lossy = True
elif fragment['class'] == 'non-lossy':
Expand All @@ -59,6 +61,7 @@ def create_fragments(anno_json):
self.clusters[fragment_cluster_id],
# IsotopeCluster(fragment_cluster_peaks, fragment_cluster['charge']),
lossy,
miss_monoiso,
fragment['sequence'],
fragment_cluster_info['calcMZ'],
error,
Expand Down Expand Up @@ -515,6 +518,7 @@ def __init__(
peptide_id,
cluster,
lossy,
missing_monoisotopic,
sequence,
calc_mz,
error,
Expand All @@ -524,6 +528,7 @@ def __init__(
self.name = name
self.peptide_id = peptide_id
self.lossy = lossy
self.missing_monoisotopic = missing_monoisotopic
self.cluster = cluster
self.sequence = sequence
self.calc_mz = float(calc_mz)
Expand Down Expand Up @@ -679,27 +684,28 @@ def as_dict(self):
deisotoped_rank = self.spectrum.get_peak_rank(
[self.get_mz(), self.get_intensity(deisotoped=True)], deisotoped=True, as_list=True)
return {
"intensity": self.get_intensity(),
"deisotoped_intensity": self.get_intensity(deisotoped=True),
"name": self.name,
"pep_id": self.peptide_id,
"calc_mz": self.calc_mz,
"match_mz": self.get_mz(),
"ppm": self.get_error_ppm(),
"charge": self.charge,
"seq": self.sequence,
"type": self.ion_type,
"number": self.ion_number,
"by_type": self.by_type,
"lossy": self.get_lossy(),
"rank": self.get_rank(),
"deisotoped_rank": deisotoped_rank,
"rel_int_base_peak": self.get_rel_int_base_peak(),
"deisotoped_rel_int_base_peak": self.get_rel_int_base_peak(deisotoped=True),
"rel_int_precursor": self.get_rel_int_precursor(),
"deisotoped_rel_int_precursor": self.get_rel_int_precursor(deisotoped=True),
"rel_int_precursor_manualMatch": self.get_rel_int_precursor(manual_match=True),
"deisotoped_rel_int_precursor_manualMatch": self.get_rel_int_precursor(
'intensity': self.get_intensity(),
'deisotoped_intensity': self.get_intensity(deisotoped=True),
'name': self.name,
'pep_id': self.peptide_id,
'calc_mz': self.calc_mz,
'match_mz': self.get_mz(),
'ppm': self.get_error_ppm(),
'charge': self.charge,
'seq': self.sequence,
'type': self.ion_type,
'number': self.ion_number,
'by_type': self.by_type,
'lossy': self.get_lossy(),
'matched_missing_monoisotopic': self.missing_monoisotopic,
'rank': self.get_rank(),
'deisotoped_rank': deisotoped_rank,
'rel_int_base_peak': self.get_rel_int_base_peak(),
'deisotoped_rel_int_base_peak': self.get_rel_int_base_peak(deisotoped=True),
'rel_int_precursor': self.get_rel_int_precursor(),
'deisotoped_rel_int_precursor': self.get_rel_int_precursor(deisotoped=True),
'rel_int_precursor_manualMatch': self.get_rel_int_precursor(manual_match=True),
'deisotoped_rel_int_precursor_manualMatch': self.get_rel_int_precursor(
deisotoped=True, manual_match=True),
'intensity_ratio': self.get_intensity_ratio(),
'deisotoped_intensity_ratio': self.get_intensity_ratio(deisotoped=True),
Expand Down
2 changes: 1 addition & 1 deletion pyxiannotator/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.6
0.2.7

0 comments on commit 3ce5cf4

Please sign in to comment.