Beispiel #1
0
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Routines import EggNOGRoutines

parser = argparse.ArgumentParser()

parser.add_argument(
    "-i",
    "--input_pep_dir",
    action="store",
    dest="input_pep_dir",
    required=True,
    type=EggNOGRoutines.check_path,
    help="Directory with input proteins(splited by families or something like)"
)
parser.add_argument("-o",
                    "--output_pep_dir",
                    action="store",
                    dest="output_pep_dir",
                    required=True,
                    type=EggNOGRoutines.check_path,
                    help="Directory to write proteins splited by species")

args = parser.parse_args()

EggNOGRoutines.split_proteins_per_species(args.input_pep_dir,
                                          args.output_pep_dir,
                                          input_format="fasta",
                                          output_format="fasta")
Beispiel #2
0
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Routines import EggNOGRoutines

parser = argparse.ArgumentParser()

parser.add_argument("-d",
                    "--dir_with_alignments",
                    action="store",
                    dest="dir_with_alignments",
                    required=True,
                    help="Directory with alignments")
parser.add_argument("-o",
                    "--output_dir",
                    action="store",
                    dest="output_dir",
                    required=True,
                    help="Directory to write extracted proteins")

args = parser.parse_args()

EggNOGRoutines.extract_proteins_from_alignments(args.dir_with_alignments,
                                                args.output_dir)
Beispiel #3
0
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import sys
import argparse
from RouToolPa.Routines import EggNOGRoutines



parser = argparse.ArgumentParser()

parser.add_argument("-i", "--fam_file", action="store", dest="fam_file", required=True,
                    help="File with families obtained from hits to hmm profiles of EggNOG")
parser.add_argument("-o", "--output", action="store", dest="output", default="stdout",
                    help="File to write output")

args = parser.parse_args()

out_fd = sys.stdout if args.output == "stdout" else open(args.output, "w")

EggNOGRoutines.edit_profile_names_in_fam_file(args.fam_file, args.output)
Beispiel #4
0
args = parser.parse_args()

hits_file = "%s/%s.hits" % (args.output_dir, args.output_prefix)
top_hits_file = "%s/%s.top_hits" % (args.output_dir, args.output_prefix)
fam_file = "%s/%s.fam" % (args.output_dir, args.output_prefix)
ortholog_file = "%s/%s.orthologs" % (args.output_dir, args.output_prefix)

HMMER3.threads = 1
HMMER3.path = args.path
HMMER3.timelog = "%s/%s.timelog" % (args.output_dir, args.output_prefix)

HMMER3.parallel_hmmscan(args.input,
                        args.input_seq,
                        args.output_prefix,
                        args.output_dir,
                        num_of_seqs_per_scan=None,
                        threads=args.threads,
                        combine_output_to_single_file=True,
                        dont_output_alignments=args.no_alignment,
                        biopython_165_compartibility=True)

HMMER3.extract_top_hits(hits_file,
                        args.output_prefix,
                        parsing_mode=args.parsing_mode)
HMMER3.get_families_from_top_hits(top_hits_file, fam_file)

EggNOGRoutines.edit_profile_names_in_fam_file(fam_file, ortholog_file)
"""
for tmp_dir in args.hmmscan_output_dir, args.tblout_dir, args.domtblout_dir, args.pfamtblout_dir, "splited_fasta":
    shutil.rmtree(tmp_dir)
"""
Beispiel #5
0
                    help="File with common names and associated ensembl ids. "
                    "Format of lines: common name\t<list of ensembl ids>")
parser.add_argument(
    "-s",
    "--species_id",
    action="store",
    dest="species_id",
    help="NCBI taxonomy id of the species. "
    "If not set ensembl ids will be treated as already labeled by species id")
parser.add_argument("-o",
                    "--output_prefix",
                    action="store",
                    dest="output_prefix",
                    required=True,
                    help="Output_prefix")
parser.add_argument("-r",
                    "--allow_repeating_of_keys",
                    action="store_true",
                    dest="allow_repeating_of_keys",
                    help="Allow repeating of keys in synonym file")

args = parser.parse_args()

EggNOGRoutines.extract_eggnog_fam_by_protein_syn_dict(
    SynDict(filename=args.input, split_values=True),
    SynDict(filename=args.protein_common_names_synonyms,
            split_values=True,
            allow_repeats_of_key=args.allow_repeating_of_keys),
    output_prefix=args.output_prefix,
    species_id=args.species_id)
Beispiel #6
0
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import sys
import argparse
from RouToolPa.Routines import EggNOGRoutines



parser = argparse.ArgumentParser()

parser.add_argument("-i", "--members_file", action="store", dest="members_file", required=True,
                    help="Members .tsv file from EggNOG")
parser.add_argument("-o", "--output", action="store", dest="output", default="stdout",
                    help="File to write output")

args = parser.parse_args()

out_fd = sys.stdout if args.output == "stdout" else open(args.output, "w")

EggNOGRoutines.convert_members_tsv_to_fam(args.members_file, args.output)
Beispiel #7
0
from RouToolPa.Routines import EggNOGRoutines

parser = argparse.ArgumentParser()

parser.add_argument("-i",
                    "--input",
                    action="store",
                    dest="input",
                    required=True,
                    help="Eggnog tsv file")
parser.add_argument("-o",
                    "--output_prefix",
                    action="store",
                    dest="output_prefix",
                    required=True,
                    help="Prefix of output files")
parser.add_argument(
    "-e",
    "--email",
    action="store",
    dest="email",
    help=
    "E-mail for request ot NCBI Taxonomy. If not set species ids will not be converted to species"
    "names by queries to NCBI Taxonomy database(requires Internet connection)")

args = parser.parse_args()

EggNOGRoutines.get_species_from_eggnog_tsv(args.input,
                                           args.output_prefix,
                                           email=args.email)