Skip to content

Instantly share code, notes, and snippets.

@iracooke
Created December 9, 2015 05:22
Show Gist options
  • Save iracooke/6901daf079b841f91c9c to your computer and use it in GitHub Desktop.
Save iracooke/6901daf079b841f91c9c to your computer and use it in GitHub Desktop.
File Cleanup for PRIDE
#!/bin/bash
# Converts an mzID file from Thermo nativeID format to scan number only nativeID format
file=$1
sed -i.bak s/controllerType\=[0-9]\ controllerNumber\=[0-9]\ // $file
sed -i.bak s/Thermo\ nativeID\ format/scan\ number\ only\ nativeID\ format/ $file
sed -i.back s/MS\:1000768/MS\:1000776/ $file
@iracooke
Copy link
Author

iracooke commented Dec 9, 2015

For some reason our MS-GF outputs end up with Thermo native ID. The ontology specifies this as

ControllerType=xsd:nonNegativeInteger controllerNumber=xsd:positiveInteger scan=xsd:positiveInteger

It can easily be converted to scan number only native ID format which looks like

Scan=xsd:nonNegativeInteger

This script used sed to convert the IDs and then update the SpectrumIDFormat tag to reflect the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment