Skip to content
Snippets Groups Projects
Commit cbae9956 authored by Mate Balajti's avatar Mate Balajti
Browse files

refactor: update main.py for CI

parent 194b18ca
No related branches found
No related tags found
1 merge request!46refactor: update main and tests for CI workflow
Pipeline #17247 passed
......@@ -58,9 +58,9 @@ def filter_df(gtf_df: pd.DataFrame, transcripts: list) -> pd.DataFrame:
& (gtf_df["free_text"].str.contains('transcript_support_level "1"'))
]
if len(transcripts) > 0:
df_filter = df_filter["free_text"].str.contains(
df_filter = df_filter[df_filter["free_text"].str.contains(
"|".join(transcripts), regex=True
)
)]
return df_filter
......@@ -159,7 +159,6 @@ def write_gtf(gtf_df: pd.DataFrame, filename: str) -> None:
sep="\t",
header=False,
index=False,
quoting=None,
quotechar="'",
mode="a",
)
......@@ -226,7 +225,7 @@ class Gtf:
annotations_file,
sep="\t",
comment="#",
names=self.dtypes.keys(),
names=list(self.dtypes.keys()),
dtype=self.dtypes,
chunksize=100000,
iterator=True,
......@@ -515,15 +514,15 @@ def sample_transcripts(
transcript_count = row["count"]
transcript_df = annotations.pick_transcript(transcript_id)
transcripts = TranscriptGenerator(
transcript_generator = TranscriptGenerator(
transcript_id,
transcript_count,
transcript_df,
prob_inclusion=prob_inclusion,
)
try:
transcripts.write_annotations(output_annotations_file)
transcripts.write_sequences(output_transcripts_file)
transcript_generator.write_annotations(output_annotations_file)
transcript_generator.write_sequences(output_transcripts_file)
except AttributeError:
pass
LOG.info("Done.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment