Skip to content

Commit

Permalink
Merge pull request #6 from anpanche/anpanche-patch-4
Browse files Browse the repository at this point in the history
Update QCQA_3.py
  • Loading branch information
anpanche authored Jan 25, 2024
2 parents 7073beb + c9ef11f commit c011fad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Alleleome/QCQA_3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pandas as pd
from Bio import SeqIO
import logging
import os

def process_sequences(pangenome_alignments_dir_path,alleleome_dir_path):
"""
Expand All @@ -13,13 +14,13 @@ def process_sequences(pangenome_alignments_dir_path,alleleome_dir_path):
try:
logging.info("Starting process_sequences in QCQA_3")

df = pd.read_csv(alleleome_dir_path + 'core_alleles_with_length_less_than_2std_less_than_mean_length.csv')
df = pd.read_csv(os.path.join(alleleome_dir_path, 'core_alleles_with_length_less_than_2std_less_than_mean_length.csv'))
gene_locus_list = set(df['Gene'].to_list())
locus_list = df['Locus_tag'].to_list()

for file_type in ['fna', 'faa']:
for gene in gene_locus_list:
allele_path = pangenome_alignments_dir_path + gene + '/input/'
allele_path = pangenome_alignments_dir_path +'/'+ gene + '/input/'
seq_file = allele_path + f'pangenes.{file_type}'
new_file = allele_path + f'pan_genes.{file_type}'
with open(seq_file, 'r') as file_in, open(new_file, 'w') as file_out:
Expand Down

0 comments on commit c011fad

Please sign in to comment.