Skip to content

Commit

Permalink
Merge pull request #761 from reid-wagner/add_fragpipe
Browse files Browse the repository at this point in the history
Add FragPipe
  • Loading branch information
bgruening authored Jul 10, 2024
2 parents 91e77c1 + 7716996 commit 905cc2b
Show file tree
Hide file tree
Showing 23 changed files with 8,211 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/fragpipe/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
owner: galaxyp
name: fragpipe
categories:
- Proteomics
description: Data analysis for mass spectrometry-based proteomics.
homepage_url: https://fragpipe.nesvilab.org/
long_description: |
FragPipe is a suite of computational tools enabling comprehensive analysis of mass spectrometry-based proteomics data.
FragPipe uses MSFragger - an ultrafast proteomic search engine suitable for both conventional and “open” (wide precursor mass tolerance) peptide identification.
remote_repository_url: https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/fragpipe
type: unrestricted
65 changes: 65 additions & 0 deletions tools/fragpipe/fragpipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# Modified version of the Bioconda wrapper of the script for command-line FragPipe, calling a local link to fragpipe instead of the version in $CONDA_PREFIX.
# Ensures the user agrees to MSFragger and IonQuant academic licenses.

license_agreement_text='
Please accept the academic license.
FragPipe uses tools that are available freely for academic research and educational purposes only.
Please provide license keys for MSFragger and IonQuant with the --msfragger_key and --ionquant_key flags. By passing these, you verify that you have read the ACADEMIC licenses for the MSFragger and IonQuant tools. You may obtain these keys by agreeing to the terms at http://msfragger-upgrader.nesvilab.org/upgrader/ and https://msfragger.arsci.com/ionquant/.'

declare -a fragpipe_args

while [[ $# -gt 0 ]]; do
case "$1" in
--msfragger_key)
shift
msfragger_key=$1
;;
--ionquant_key)
shift
ionquant_key=$1
;;
--workflow)
fragpipe_args+=("$1")
shift
workflow_file="$1"
fragpipe_args+=("$1")
;;
*)
fragpipe_args+=("$1")
;;
esac
shift
done

if [[ ! -z "$workflow_file" ]]; then
# Because the DIA-NN license is incompatible with bioconda, we remove the feature.
grep 'diann.run-dia-nn=true' "$workflow_file" >/dev/null
if [[ $? -eq 0 ]]; then
echo "Error: DIA-NN is disabled in the FragPipe bioconda package."
exit 1
fi
fi

if [[ -z $msfragger_key || -z $ionquant_key ]]; then
echo "$license_agreement_text"
exit 1
else
msfragger --key $msfragger_key --help | grep 'License key verified' >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Error: Invalid MSFragger license key"
echo "$license_agreement_text"
exit 1
fi
ionquant --key $ionquant_key --help | grep 'License key verified' >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Error: Invalid IonQuant license key"
echo "$license_agreement_text"
exit 1
fi
fi

sh fragpipe_local/bin/fragpipe "${fragpipe_args[@]}"
276 changes: 276 additions & 0 deletions tools/fragpipe/fragpipe.xml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions tools/fragpipe/genericize_db.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
#
# Prefixes sequence headers in the input FASTA file that are not formatted according to the UniProt, NCBI, or ENSEMBL formats with '>generic|' to avoid being misinterpreted by Philosopher.
#

import re
import sys

input_db_file = sys.argv[1]
output_db_file = sys.argv[2]


def sub_header(line):
return re.sub(r'^>(?!sp\||tr\||db\||AP_|NP_|YP_|XP_|WP_|ENSP|UniRef|nxp|generic)', '>generic|', line)


with open(input_db_file) as in_file, open(output_db_file, 'w') as out_file:
for line in in_file:
out_file.write(sub_header(line))
Loading

0 comments on commit 905cc2b

Please sign in to comment.