Пример #1
0
parser = CustomParser(description = description)
parser.add_fasta(help="The fasta file to match peptides against.")
parser.add_out(help="The name of the file you wish to create with results appended.")
parser.add_argument('--peptide-out', nargs='?', help="The file to write digested products to.", type=argparse.FileType('w'), default=os.devnull)
parser.add_argument('--protein-out', nargs='?', help="The file to write grouped products to.", type=argparse.FileType('w'), default=os.devnull)
parser.add_argument('--strict', help='For numeric operations, fail if types are incorrect (converting NA to a float for instance).', action='store_true')
parser.add_delimited_file(cols=['--peptide-col'], col_default='Peptide')
parser.add_argument('-r', '--regex', help="A perl regular expression determining which parts of the header to capture.", type=str)
parser.add_argument('--inferred-name', help="The name you want to assign for protein inference (in case you are regexing for gene names or something).", type=str, default='Proteins')
parser.add_argument('--no-inference', help="Do not append proteins inferred from sequences.", action='store_true')
parser.add_argument('--no-equality', help="Do not consider Leucine and Isoleucine equal for peptide mapping.", action='store_true')
ibaq_group = parser.add_argument_group('iBAQ related options')
ibaq_group.add_argument('--ibaq', help="Provide to append iBAQ values as well (requires protein inference).", action='store_true')
ibaq_group.add_argument('--precursors', help="The column with precursor area (defaults to header lines containing 'Precursor').", type=str)
parser.add_column_function('', col_argument='--ibaq-function', group=ibaq_group, col_help="The function to apply to groups of iBAQ values (for multiple peptide matches).", parent=False)
ibaq_group.add_argument('--non-redundant', help="Use only non-redundant theoretical tryptic peptides for the iBAQ denominator.", action='store_true')
parser.add_enzyme(help="The enzyme used to digest the sample.")
ibaq_group.add_argument('--normalize', help="Normalize iBAQ to total intensity of column (useful for comparing multiple samples).", action='store_true')
protein_group = parser.add_argument_group('Protein Grouping Options')
protein_group.add_argument('--unique-only', help="Only group proteins with unique peptides", action='store_true')
protein_group.add_argument('--position', help="Write the position of the peptide matches.", action='store_true')
protein_group.add_argument('--case-sensitive', help="Treat peptides as case-sensitive (ie separate modified peptides)", action='store_true')
mod_group = parser.add_argument_group('Peptide Modification Options')
mod_group.add_argument('--mod-out', nargs='?', help="The file to write a modification-centric summary to.", type=argparse.FileType('w'), default=None)
mod_group.add_argument('--modification-site', help="Write the position in the parent protein of the modification (requires case-sensitive and modifications being lower-cased).", action='store_true')
parser.add_column_function('--mod-col', help="The column containing modification information.", group=mod_group)
motif_group = mod_group.add_argument_group('Motif Options')
motif_group.add_argument('--motifs', help="Enable creation of motifs for each modification.", action='store_true')
motif_group.add_argument('--motif-window', help="The width of the motif window (how many residues to go out from each modification).", type=int, default=10)
motif_group.add_argument('--motif-unique', help="Only output motifs where the peptide mapping is unambiguous.", action='store_true')
Пример #2
0
with the --substring flag (ex: peptides LNGERPEPTIDE and ERPEPT will be merged
into LNGERPEPTIDE).
"""

import argparse, sys, re, csv, copy, decimal
from pythomics.templates import CustomParser
import pythomics.proteomics.config as config
import pythomics.proteomics.digest as digest
import pythomics.parsers.fasta as fasta
from pythomics.utils import ColumnFunctions

parser = CustomParser(description = description)
parser.add_delimited_file(cols=['--group-on'])
parser.add_out()
parser.add_argument('--substring', help='If set, merge features by partial matches (such as collapsing peptides into larger peptides)', action='store_true')
parser.add_column_function('--summary-col', col_help="The function to apply to grouped entries in modification columns.")
parser.add_argument('--summary-col-delimiter', help="If the summary column has a delimiter, such as a ; for multiple proteins.")
parser.add_argument('--strict', help='For numeric operations, fail if types are incorrect (converting NA to a float for instance).', action='store_true')
parser.add_argument('--merge', help='Merge together identical entries.', action='store_true')
# parser.add_argument('--merge-columns', help="If set, columns of merged peptides will be combined.", action='store_true')
# parser.add_argument('--merge-delimiter', help='The delimiter for column merges.', type=str, default=';')
parser.add_argument('--case-sensitive', help="Treat peptides as case-sensitive (ie separate modified peptides)", action='store_true')

def main():
    args = parser.parse_args()
    peptide_colname = False
    try:
        peptide_column = int(args.group_on)
        peptide_column = peptide_column-1 if peptide_column > 0 else peptide_column
    except ValueError:
        peptide_colname = True
Пример #3
0
from pythomics.templates import CustomParser
import pythomics.proteomics.config as config
import pythomics.proteomics.digest as digest
import pythomics.parsers.fasta as fasta
from pythomics.utils import ColumnFunctions

parser = CustomParser(description=description)
parser.add_delimited_file(cols=['--group-on'])
parser.add_out()
parser.add_argument(
    '--substring',
    help=
    'If set, merge features by partial matches (such as collapsing peptides into larger peptides)',
    action='store_true')
parser.add_column_function(
    '--summary-col',
    col_help="The function to apply to grouped entries in modification columns."
)
parser.add_argument(
    '--summary-col-delimiter',
    help=
    "If the summary column has a delimiter, such as a ; for multiple proteins."
)
parser.add_argument(
    '--strict',
    help=
    'For numeric operations, fail if types are incorrect (converting NA to a float for instance).',
    action='store_true')
parser.add_argument('--merge',
                    help='Merge together identical entries.',
                    action='store_true')
# parser.add_argument('--merge-columns', help="If set, columns of merged peptides will be combined.", action='store_true')
Пример #4
0
    help="Do not consider Leucine and Isoleucine equal for peptide mapping.",
    action='store_true')
ibaq_group = parser.add_argument_group('iBAQ related options')
ibaq_group.add_argument(
    '--ibaq',
    help="Provide to append iBAQ values as well (requires protein inference).",
    action='store_true')
ibaq_group.add_argument(
    '--precursors',
    help=
    "The column with precursor area (defaults to header lines containing 'Precursor').",
    type=str)
parser.add_column_function(
    '',
    col_argument='--ibaq-function',
    group=ibaq_group,
    col_help=
    "The function to apply to groups of iBAQ values (for multiple peptide matches).",
    parent=False)
ibaq_group.add_argument(
    '--non-redundant',
    help=
    "Use only non-redundant theoretical tryptic peptides for the iBAQ denominator.",
    action='store_true')
parser.add_enzyme(help="The enzyme used to digest the sample.")
ibaq_group.add_argument(
    '--normalize',
    help=
    "Normalize iBAQ to total intensity of column (useful for comparing multiple samples).",
    action='store_true')
protein_group = parser.add_argument_group('Protein Grouping Options')