From 695ef43a16d62074ad0ea1154f3def3f98ae3339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Wed, 25 Oct 2023 11:22:04 +0200 Subject: [PATCH] semantic fixes --- scRNAsim_toolz/cdna_generator/cdna.py | 8 +++++--- scRNAsim_toolz/structure_generator/main.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scRNAsim_toolz/cdna_generator/cdna.py b/scRNAsim_toolz/cdna_generator/cdna.py index c2e2bed..a4f2c29 100644 --- a/scRNAsim_toolz/cdna_generator/cdna.py +++ b/scRNAsim_toolz/cdna_generator/cdna.py @@ -212,17 +212,19 @@ def read_gtf(self) -> None: ) # Calculate Normalized_Binding_Probability and add to GTF dataframe csv_transcript_copy_number = self.csv_df.loc[ - self.csv_df.iloc[:, 1] == int(id_csv), "Transcript copy number", + self.csv_df.iloc[:, 1] == int(id_csv), + "Transcript copy number", ].iloc[0] # pop the first value in the frame gtf_df.loc[index, "Transcript_Copy_Number"] = round( csv_transcript_copy_number * gtf_df.loc[index, "Normalized_Binding_Probability"] ) - gtf_df.loc[index, "Transcript_Copy_Number"] gtf_df.loc[index, "cdna_ID"] = f"{id_}_{count}" prev_id = id_ - gtf_df['Transcript_Copy_Number'] = gtf_df['Transcript_Copy_Number'].astype(int) + gtf_df['Transcript_Copy_Number'] = gtf_df[ + 'Transcript_Copy_Number' + ].astype(int) self.gtf_df = gtf_df def write_fasta(self) -> None: diff --git a/scRNAsim_toolz/structure_generator/main.py b/scRNAsim_toolz/structure_generator/main.py index 1a453f7..c53e6f7 100644 --- a/scRNAsim_toolz/structure_generator/main.py +++ b/scRNAsim_toolz/structure_generator/main.py @@ -442,7 +442,8 @@ def write_sequences(self, filename: str) -> None: # Add header to output csv for cdna-generator if file_handle.tell() == 0: file_handle.write( - "ID of transcript,ID of parent transcript,Transcript copy number\n" + "ID of transcript,ID of parent transcript," + "Transcript copy number\n" ) for transcript_id, transcript_count in zip(ids, counts):