Skip to content

Commit

Permalink
run ruff format scripts/
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorreiter committed Feb 15, 2024
1 parent 5ad5e33 commit 10da5c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
28 changes: 7 additions & 21 deletions scripts/extract_deeppeptide_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ def read_fasta(fasta_file):
return sequences


def extract_peptide_sequences(
data, fasta_file, proteins_output_file, peptides_output_file
):
def extract_peptide_sequences(data, fasta_file, proteins_output_file, peptides_output_file):
"""
Extract gene and peptide sequences based on the data dictionary and FASTA file,
then write to separate files.
Expand Down Expand Up @@ -78,29 +76,17 @@ def main(json_file, fasta_file, proteins_output_file, peptides_output_file):
with open(json_file) as f:
data = json.load(f)

extract_peptide_sequences(
data, fasta_file, proteins_output_file, peptides_output_file
)
extract_peptide_sequences(data, fasta_file, proteins_output_file, peptides_output_file)


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Extract peptide sequences from DeepPeptide JSON."
)
parser = argparse.ArgumentParser(description="Extract peptide sequences from DeepPeptide JSON.")

# Add the arguments
parser.add_argument(
"json_file", type=str, help="The JSON file output by DeepPeptide."
)
parser.add_argument(
"fasta_file", type=str, help="The protein FASTA file input to DeepPeptide."
)
parser.add_argument(
"proteins_output_file", type=str, help="The output file path for proteins."
)
parser.add_argument(
"peptides_output_file", type=str, help="The output file path for peptides."
)
parser.add_argument("json_file", type=str, help="The JSON file output by DeepPeptide.")
parser.add_argument("fasta_file", type=str, help="The protein FASTA file input to DeepPeptide.")
parser.add_argument("proteins_output_file", type=str, help="The output file path for proteins.")
parser.add_argument("peptides_output_file", type=str, help="The output file path for peptides.")

# Execute the parse_args() method
args = parser.parse_args()
Expand Down
4 changes: 1 addition & 3 deletions scripts/run_nlpprecursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ def main(models_dir, multifasta_file, output_tsv):

if __name__ == "__main__":
if len(sys.argv) != 4:
print(
"Usage: python run_nlpprecursor.py <models_dir> <multifasta_file> <output_tsv>"
)
print("Usage: python run_nlpprecursor.py <models_dir> <multifasta_file> <output_tsv>")
sys.exit(1)

models_dir = sys.argv[1]
Expand Down

0 comments on commit 10da5c3

Please sign in to comment.