This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Step 2 Error Intron Clustering For LeafCutter

My script (the path to juncfiles_list is already defined:

# Presets

## Maximum intron length
max_intron_length_predefined=50

## Maximum number of reads to process
max_reads_predefined=500000

# Path to clustering/leafcutter_cluster_regtools.py in the Leafcutter cloned directory:
leafcutter_script_path="path/to/leafcutter_cluster_regtools.py"

# Directory containing the junction files list
juncfiles_directory="$(dirname "${juncfiles_list}")"

# Output directory name (parent of juncfiles_dir)
output_dir="$(dirname "${juncfiles_directory}")/Step_2_Intron_Clustering"

# Create the output directory if it doesn't exist
mkdir -p "${output_dir}"

# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

# Run leafcutter_cluster_regtools.py
python "${leafcutter_script_path}" \
    -j "${juncfiles_list}" \
    -m "${max_intron_length_predefined}" \
    -o "${output_dir}" \
    -l "${max_reads_predefined}"

#________________________________________________________________________________________________________________

Gives the following error:

scanning 1/12: /path/to/Control_1.bam.junc
## On and on till 12 of 12
scanning 12/12: /path/to/Experimental_6.bam.junc ...
Traceback (most recent call last):
  File "/path/to/leafcutter_cluster_regtools.py", line 538, in <module>
    main(options, libl)
  File "/path/to/leafcutter_cluster_regtools.py", line 16, in main
    pool_junc_reads(libl, options)
  File "path/to/leafcutter_cluster_regtools.py", line 71, in pool_junc_reads
    fout = open(outFile, 'w')
FileNotFoundError: [Errno 2] No such file or directory: './//path/to/Step_2_Intron_Clustering_pooled'

Why would it give this error? Why add a ./// a triple /?

bash leafcutter

Please change path to leafcutter_cluster_regtools.py in your script

leafcutter_script_path="path/to/leafcutter_cluster_regtools.py"

I checked the path is correct to leafcutter_cluster_regtools.py? I double checked every path.

1 answer

I found the error it seems that -o is not for output but for output prefix. Once it is changed to a prefix such as prefix___ or Part_2___ it works.

Log in to answer this question.