Skip to content

Commit

Permalink
csv to tabular output
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgowan committed Oct 14, 2020
1 parent 9619831 commit e9c34c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions psmfragmentation/psmfragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def generate_output(self):
self._fragment_percent()
self._unmatched_peaks()
r_keys = ('peptideSequence','spectrumID', 'spectrumTitle', 'scanFile','PSPSMScore', 'PSPSMConfidence','TIC','max_b_run','max_y_run','pct_b_peaks_matched', 'pct_y_peaks_matched','num_peaks_unmatched_10pct')
with open('results.csv', 'w') as f:
f.write(f"sequence,spectrumID,spectrumTitle,scanFile,PSScore,PSConfidence,TIC,Max_B_Run, Max_Y_Run,PCT_B_Matched, PCT_Y_Matched,Num_10Pct_Peaks_Unmatched")
with open('results.tab', 'w') as f:
f.write(f"sequence\tspectrumID\tspectrumTitle\tscanFile\tPSScore\tPSConfidence\tTIC\tMax_B_Run\tMax_Y_Run\tPCT_B_Matched\t PCT_Y_Matched\tNum_10Pct_Peaks_Unmatched")
f.write(os.linesep)
for _, entry in self._results.items():
line = ''
for k in r_keys:
line += f"{entry[k]},"
line += f"{entry[k]}\t"
line = line[:-1]
f.write(line)
f.write(os.linesep)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import setuptools

_pkg_version = "1.0.2"
_pkg_version = "1.0.3"
_author = "Thomas McGowan"
_author_email = "[email protected]"
_license = "MIT"
Expand Down

0 comments on commit e9c34c8

Please sign in to comment.