Skip to content

Commit

Permalink
removed allele calls to numeric form; changed all file types to .tsv
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmitchell committed Apr 11, 2024
1 parent 81cd1c8 commit ae2e7f7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lusSTR/wrappers/snps_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def kintelligence_filtering(input):


def create_output_table(sample_df, orientation, separate, output_type, software):
allele_des = {"A": "1", "C": "2", "G": "3", "T": "4"}
if orientation == "uas":
allele_col = "UAS_Allele"
else:
Expand All @@ -41,7 +40,6 @@ def create_output_table(sample_df, orientation, separate, output_type, software)
compiled_table = create_sample_df(indiv_df, output_type, allele_col)
if software != "uas":
compiled_table = check_allele_calls(compiled_table, output_type)
compiled_table = compiled_table.replace(allele_des)
compiled_table.insert(0, "Sample.Name", sample)
all_samples_df = pd.concat([all_samples_df, compiled_table])
if separate:
Expand Down Expand Up @@ -187,11 +185,11 @@ def main(input, output, kit, strand, separate, refs, software, thresh):
ref_samples = results[results["SampleID"].isin([refs])]
if len(ref_samples) > 0:
ref_table = create_output_table(ref_samples, strand, separate, "reference", software)
ref_table.to_csv(f"{output_name}_snp_reference.csv", index=False, sep="\t")
ref_table.to_csv(f"{output_name}_snp_reference.tsv", index=False, sep="\t")
evid_samples = results[~results.SampleID.isin(ref_ids)]
if len(evid_samples) > 0:
evid_table = create_output_table(evid_samples, strand, separate, "evidence", software)
evid_table.to_csv(f"{output}_snp_evidence.csv", index=False, sep="\t")
evid_table.to_csv(f"{output}_snp_evidence.tsv", index=False, sep="\t")


if __name__ == "__main__":
Expand Down

0 comments on commit ae2e7f7

Please sign in to comment.