Skip to content
Snippets Groups Projects

minor changes based on pylint

Merged Samuel Mondal requested to merge new into master
4 files
+ 32
22
Compare changes
  • Side-by-side
  • Inline
Files
4
import pandas as pd
import argparse
from gtfparse import read_gtf
"""This script defines a BED from exon annotation in a GTF, to get exon coordinates for use in bedtools. It also ensures that the concatenation happens in the correct order, regardless of the strandedness of the transcript.
Args:
@@ -11,6 +7,10 @@ from gtfparse import read_gtf
BED file with the format: chr, start, end, transcript_id, score, strand, gene_id
"""
import argparse
import pandas as pd
from gtfparse import read_gtf
parser = argparse.ArgumentParser(
prog = 'pre_bedtools',
description = 'extracts ordered information from gtf file and for transcripts in the negative strand, flips the order in which exons are ordered.')
@@ -31,4 +31,3 @@ gtf_df_pos = gtf_exons[gtf_exons["strand"] == "+"]
gtf_df_pos = gtf_df_pos.sort_values(['transcript_id','start'],ascending=True).groupby('transcript_id').head(len(gtf_df_pos. transcript_id))
pd.concat([gtf_df_pos, gtf_df_neg]).to_csv(args.output_bed_file,sep="\t",index=False) #gtf_df_pos and gtf_df_neg must be dataframes
Loading