Entering edit mode
12 months ago
Y
•
0
I am trying to use CuffDiff (from Cufflinks version 2.2.1) on 3 controls and 3 experimental samples. The variables used and the main section of code in a bash script is below:
The variables that are predefined:
bam_directory
is the path to the 3 controls and 3 experimental.bam
containing folderoutput_directory
is the path to the output folderreference_genome
path to the Danio_rerio GRCz11soft masked primary assembly fasta file (from Ensembl)annotation_gtf
is the path to the Danio_rerio GRCz11.110 gtf file (from Ensembl)num_threads
is set to an arbitrary number, I set it to 10 but it can be any other number
The main section of code that is giving the error:
control_bams=($(find "${bam_directory}" -type f -name "Control*.bam"))
experimental_bams=($(find "${bam_directory}" -type f -name "Experimental*.bam"))
cuffdiff -u "${annotation_gtf}" \
-o "${output_directory}" \
-b "${reference_genome}" \
-p "${num_threads}" \
--FDR 0.05 \
--verbose 2 \
-no-update-check \
--library-type fr-firststrand \
"${control_bams[*]}" \
"${experimental_bams[*]}"
Yet I keep getting the error:
open: No such file or directory Error: cannot open file 2 for reading. Unrecognized file type
The files are .bam
files. The .gtf
has been used before without any issues.The fasta has been used before without any issues why is it giving this error. The paths have be quadruple checked and I think they are correct.
I did not use the space between the
-u
flag and the-o
flag (the blank line) but I did do what you recommended:This gives me the same error:
It is still the same issue.
then test each files.
I tried the commands you recommended in the bash/command line. When I tried
find "${bam_directory}" -type f -name "*.bam" | xargs samtools quickcheck
and nothing printed to this screen so I tried a modified version (just as a check) shown below aftercd
into the bam directory:It checked each file and then no error was printed to the screen.
I tried the other command you recommended:
And this gave an output that was
/path/not/given/due/to/HPC/rules/Danio_rerio.GRCz11_soft_masked_primary_assembly_from_Ensembl.fa: ASCII text
I think the error is associated with the
.gtf
file but I have used the.gtf
before and not had any issue.So I tried (after giving it the path to the
annotation_gtf
in command line :And it give me the output:
but that doesn't help me with why my error is occurring.
I figured out how to make it work. The bams have to be comma separated not just by space:
It seems that
--library-type
and the path to the gtf are the only paths that need to be defined other than the.bam
in the input directory containing the bams. While this does not have all the options I had before it does work once:,
instead of space is used between the specified.bam
files-u
and just specified the gtf pathPlaced the
-o
plus the output directory path right at the top next to thecuffdiff
commandThere will be ways to make this more elegant or easier to use but I did get this as a work around and I wanted to put it up for anyone else who can benefit from it.