Skip to content

Commit

Permalink
Linting with the new version of Black 23.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasZepper committed Feb 3, 2023
1 parent a147b4e commit 0012b42
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 241 deletions.
2 changes: 0 additions & 2 deletions bin/check_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def check_samplesheet(file_in, file_out):

sample_mapping_dict = {}
with open(file_in, "r", encoding="utf-8-sig") as fin:

## Check header
MIN_COLS = 3
HEADER = ["sample", "fastq_1", "fastq_2", "strandedness"]
Expand Down Expand Up @@ -142,7 +141,6 @@ def check_samplesheet(file_in, file_out):
",".join(["sample", "single_end", "fastq_1", "fastq_2", "strandedness"] + header[len(HEADER) :]) + "\n"
)
for sample in sorted(sample_mapping_dict.keys()):

## Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end
if not all(x[0] == sample_mapping_dict[sample][0][0] for x in sample_mapping_dict[sample]):
print_error(
Expand Down
1 change: 0 additions & 1 deletion bin/filter_gtf_for_genes_in_genome.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def extract_genes_in_genome(fasta, gtf_in, gtf_out):
n_lines_in_genome = 0
with open(gtf_out, "w") as f:
with open(gtf_in) as g:

for line in g.readlines():
n_total_lines += 1
seq_name_gtf = line.split("\t")[0]
Expand Down
1 change: 0 additions & 1 deletion bin/mqc_features_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


def mqc_feature_stat(bfile, features, outfile, sname=None):

# If sample name not given use file name
if not sname:
sname = os.path.splitext(os.path.basename(bfile))[0]
Expand Down
7 changes: 0 additions & 7 deletions bin/prepare-for-rsem.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def chunk_bam(bamfile):
output_buffer = list()

for read in bamfile:

if last_query_name is not None and last_query_name != read.query_name:
yield (output_buffer)
output_buffer = list()
Expand All @@ -84,7 +83,6 @@ def copy_tags(tags, read1, read2):
to read2, if the tag is set"""

for tag in tags:

try:
read1_tag = read1.get_tag(tag, with_value_type=True)
read2.set_tag(tag, value=read1_tag[0], value_type=read1_tag[1])
Expand Down Expand Up @@ -122,7 +120,6 @@ def pick_mate(read, template_dict, mate_key):


def main(argv=None):

if argv is None:
argv = sys.argv

Expand Down Expand Up @@ -174,7 +171,6 @@ def main(argv=None):
options.tags = options.tags.split(",")

for template in chunk_bam(inbam):

assert len(set(r.query_name for r in template)) == 1
current_template = {True: defaultdict(list), False: defaultdict(list)}

Expand All @@ -185,7 +181,6 @@ def main(argv=None):
output = set()

for read in template:

mate = None

# if this read is a non_primary alignment, we first want to check if it has a mate
Expand Down Expand Up @@ -231,7 +226,6 @@ def main(argv=None):
# each pair twice - once when we scan read1 and once when we scan read2. Thus we need
# to make sure we don't output something already output.
if read.is_read1:

mate = copy_tags(options.tags, read, mate)
output_key = str(read) + str(mate)

Expand All @@ -242,7 +236,6 @@ def main(argv=None):
skipped_stats["pairs_output"] += 1

elif read.is_read2:

read = copy_tags(options.tags, mate, read)
output_key = str(mate) + str(read)

Expand Down
Loading

0 comments on commit 0012b42

Please sign in to comment.