Skip to content

Uncategorized

Ralf Gabriels edited this page Jun 19, 2018 · 2 revisions

Here are some scripts that haven't been categorized yet, or that don't fall into any category that is specific enough.


Download PRIDE Project

Download PRIDE project files for a given PRIDE identifier. With the -f argument certain file types can be chosen for download.

Download_PRIDE_Project.py
Input: PRIDE Archive identifier
Output: Downloaded files, sorted in folders by file type

usage: Download_PRIDE_Project.py [-h] [-f FILETYPES [FILETYPES ...]] projectID

Download files from PRIDE Archive for a given project.

positional arguments:
  projectID             PRIDE identifier from project to download files from

optional arguments:
  -h, --help            show this help message and exit
  -f FILETYPES [FILETYPES ...]
                        filetypes to download (msf, raw, txt, zip...)

Calculate Q-Values

For a dataset with scored targets and decoys, return the q-value associated with each.

calculate_qvalue.py

Input: pandas.DataFrame with score column, and decoy-labeling column

Output: pandas.Series Qval with calculated q-values

Send email from Python using SendGrid

Get (free) API key at https://sendgrid.com/ and install using: $ pip install sendgrid. See code for code snippet.

Sort modifications in .sptxt spectral library

Sort modifications properly in a SpectraST .sptxt spectral library file.

After parsing an MSP spectral library file through SpectraST to convert it to an .sptxt file, other software tools (Deliberator) threw an error: molecule {15.99}({57.02} not found. The modifications were not sorted by location in the sequence...

This script parses the .sptxt file and writes a new file with the modifications sorted properly. For instance, Mods=2/12,M,Oxidation/5,C,Carbamidomethyl becomes Mods=2/5,C,Carbamidomethyl/12,M,Oxidation.

The tqdm libarary is used to display progress.

sptxt_sort_modifications.py
Input: .sptxt spectral library
Output: .sptxt spectral library with modifications sorted properly

usage: sptxt_sort_modifications.py [-h] input_file

Sort modifications properly in a SpectraST .sptxt spectral library file.

positional arguments:
  input_file  Input .sptxt file

optional arguments:
  -h, --help  show this help message and exit