Skip to content

Commit

Permalink
closing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Marta Lopez Balastegui committed Oct 18, 2021
1 parent bb1e88a commit 56ab43a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions XICRA_pip/XICRA/modules/biotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,20 @@ def run_biotype(options):

## debug message
if (Debug):
print (colored("**DEBUG: mapping_results **", 'yellow'))
print (mapping_results)
print (colored("**DEBUG: mapping_results **", 'yellow'))
print (mapping_results)

# time stamp
start_time_partial = time_functions.timestamp(start_time_partial)

## for samples
biotype_outdir_dict = files_functions.outdir_project(outdir, options.project, pd_samples_retrieved, "biotype", options.debug)

## debug message
if (Debug):
print (colored("**DEBUG: biotype_outdir_dict **", 'yellow'))
print (biotype_outdir_dict)

## multimapping:
if options.no_multiMapping:
multimapping = False
Expand Down
15 changes: 9 additions & 6 deletions XICRA_pip/XICRA/scripts/RNAbiotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def biotype_all(featureCount_exe, path, gtf_file, bam_file, name, threads, Debug
stamp = time_functions.read_time_stamp(filename_stamp_featureCounts)
print (colored("\tA previous command generated results on: %s [%s -- %s]" %(stamp, name, 'featureCounts'), 'yellow'))
else:

## debugging messages
if Debug:
print ("** DEBUG:")
Expand Down Expand Up @@ -160,7 +160,7 @@ def parse_featureCount(out_file, path, name, bam_file, Debug):
string2write = "tRNA\t%s\n" %tRNA_count
RNA_biotypes_file.write(string2write)
RNA_biotypes_file.close()

##########################################
### read summary count file
##########################################
Expand Down Expand Up @@ -265,7 +265,9 @@ def parse_featureCount(out_file, path, name, bam_file, Debug):

## close files
out_tsv_file.close()

summary_count_file.close()
mapping_stats_file.close()
count_file.close()
## print timestamp
time_functions.print_time_stamp(filename_stamp_parse)

Expand Down Expand Up @@ -345,7 +347,7 @@ def pie_plot_results(RNAbiotypes_stats_file, name, folder, Debug):
stamp = time_functions.read_time_stamp(filename_stamp_plot)
print (colored("\tA previous command generated results on: %s [%s -- %s]" %(stamp, name, 'plot results'), 'yellow'))
else:

# PLOT and SHOW results
RNAbiotypes_stats = main_functions.get_data(RNAbiotypes_stats_file, '\t', 'header=None')

Expand Down Expand Up @@ -397,9 +399,10 @@ def pie_plot_results(RNAbiotypes_stats_file, name, folder, Debug):
name_figure = os.path.join(folder, name + '_RNAbiotypes.pdf')

## generate image
plt.savefig(name_figure)
plt.savefig(name_figure)
plt.close(name_figure)

plt.close()

## print time stamps
time_functions.print_time_stamp(filename_stamp_plot)
filename_stamp_all = folder + '/.success_all'
Expand Down
1 change: 1 addition & 0 deletions XICRA_pip/XICRA/scripts/fastqc_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
from sys import argv
from io import open
from termcolor import colored

## import my modules
from HCGB import functions
Expand Down

0 comments on commit 56ab43a

Please sign in to comment.