Skip to content

Instantly share code, notes, and snippets.

@jamessdixon
Last active June 7, 2023 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamessdixon/6792e9b9ea794638599571089d90656e to your computer and use it in GitHub Desktop.
Save jamessdixon/6792e9b9ea794638599571089d90656e to your computer and use it in GitHub Desktop.
file_name = 'clusters_' + flavor + '.csv'
with open(file_name, 'w') as t:
header = 'score'+ '\t'+ 'pid'+ '\t'+ 'start'+ '\t'+ 'end'+ '\t'+ 'mz'+ '\t'+ 'charge' + "\n"
t.write(header)
for y_cluster in y_clusters:
item = str(y_cluster.score)+ '\t' + str(y_cluster.pid)+ '\t' + str(y_cluster.start)+ '\t' + str(y_cluster.end)+ '\t' + str(y_cluster.mz)+ '\t' + str(y_cluster.charge) + "\n"
with open(file_name, 'a') as t:
t.write(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment