Skip to content

Commit

Permalink
change in masstable.py reading scan number.
Browse files Browse the repository at this point in the history
  • Loading branch information
KyowonJeong committed May 29, 2024
1 parent 9a6cc4b commit 3c5bed2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/masstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,22 @@ def parseFLASHDeconvOutput(annotated, deconvolved):

for k in scoreMaps:
df[k] = scoreMaps[k]

spec_index = 1;
for spec, specPeaks in zip(annotated_exp, allPeaks):
mstr = spec.getMetaValue('DeconvMassPeakIndices')
# Split the string into peak items
peak_items = mstr.split(';')
type_accession = 'MS:1000768'
sourcefiles = annotated_exp.getSourceFiles()
scan_number = SpectrumLookup().extractScanNumber(spec.getNativeID(), sourcefiles[0].getNativeIDTypeAccession()) if sourcefiles else -1

if sourcefiles:
type_accession = sourcefiles[0].getNativeIDTypeAccession()
if not type_accession:
type_accession = 'MS:1000768'

scan_number = SpectrumLookup().extractScanNumber(spec.getNativeID(), type_accession)
scan_number = scan_number if scan_number > 0 else spec_index
spec_index = spec_index + 1
scans.append(scan_number)
# Create a list to store the parsed peaks
parsed_peaks = []
Expand Down Expand Up @@ -169,7 +178,6 @@ def parseFLASHDeconvOutput(annotated, deconvolved):
df['CombinedPeaks'] = noisyPeaks
df['MSLevel'] = msLevels
df['Scan'] = scans

return df, annotateddf, tolerance, massoffset, chargemass


Expand Down
1 change: 0 additions & 1 deletion src/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def getFragmentDataFromSeq(sequence, coverage=None, maxCoverage=None):
prefix_ions, suffix_ions = getFragmentMassesWithSeq(protein, ion_type)
out_object['fragment_masses_%s' % ion_type[0]] = prefix_ions
out_object['fragment_masses_%s' % ion_type[1]] = suffix_ions

return out_object

# Define amino acid masses with high resolution
Expand Down

0 comments on commit 3c5bed2

Please sign in to comment.