Skip to content

Commit

Permalink
semantic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Oct 25, 2023
1 parent 572a10a commit 695ef43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions scRNAsim_toolz/cdna_generator/cdna.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion scRNAsim_toolz/structure_generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 695ef43

Please sign in to comment.