Michael Levin
10/23/2024, 3:29 PMnf-core/rnasplice pipeline with using USCS files. Last time I successfully ran them, the GTF and FASTA files were both Ensembl format. However, 1) my boss ran hers with USCS (last year, older's: mm10 instead of mm39) and 2) we are getting different results. So, for better reproducibility, we think it’s best if I restart mine but with `USCS`’s FASTA and GTF files. I’ve 1) downloaded `USCS`’s genome FASTA and GTF files through these:
FASTA:
# Download the genome FASTA file
wget <https://hgdownload.soe.ucsc.edu/goldenPath/mm39/bigZips/mm39.fa.gz>
# Uncompress the FASTA file
gunzip mm39.fa.gz
GTF:
# Download the RefSeq GTF file
wget <https://hgdownload.soe.ucsc.edu/goldenPath/mm39/bigZips/genes/mm39.ncbiRefSeq.gtf.gz>
# Uncompress the GTF file
gunzip mm39.ncbiRefSeq.gtf.gz
# Rename the file for clarity (optional)
mv mm39.ncbiRefSeq.gtf mm39_RefSeq.gtf
And, rebuild both STAR and salmon index through these:
Rebuild STAR index:
STAR --runMode genomeGenerate \
--genomeDir /home/tud03125/STAR_index_mouse_ucsc \
--genomeFastaFiles /home/tud03125/pipeline/mm39.fa \
--sjdbGTFfile /home/tud03125/pipeline/mm39_RefSeq.gtf \
--sjdbOverhang 100
Rebuild salmon index:
# Generate transcriptome FASTA using gffread
gffread /home/tud03125/pipeline/mm39_RefSeq.gtf \
-g /home/tud03125/pipeline/mm39.fa \
-w /home/tud03125/pipeline/mm39_transcripts.fa
# Build the Salmon index using the generated transcriptome FASTA file
salmon index \
-t /home/tud03125/pipeline/mm39_transcripts.fa \
-i /home/tud03125/salmon_index_mouse_ucsc
So after gathering `USCS`’s FASTA and GTF files, and rebuilding indexes from `USCS`’s files, I re-ran the pipeline using that format:
#!/bin/bash
# Debugging: Print environment information
echo "Job started on $(date)"
echo "Running on $(hostname)"
echo "Current directory: $(pwd)"
# Output directory
OUTPUT_DIR="/home/tud03125/pipeline/mouse_liver_rnasplice_UCSC"
# Create the output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"
# Load necessary modules
module load gcc/11.2.0
module load singularity
# Change directory to your pipeline directory
cd /home/tud03125/pipeline
# Set Nextflow version
export NXF_VER=24.04.4
# Install Nextflow if not already installed
if [ ! -f ./nextflow ]; then
echo "Nextflow not found, downloading..."
curl -s <https://get.nextflow.io> | bash
chmod +x nextflow
fi
# Set Nextflow work directory to avoid quota issues
export NXF_WORK="$OUTPUT_DIR/work"
# Extract gene versions for MISO_SASHIMI
#GTF_FILE="/home/tud03125/pipeline/Mus_musculus.GRCm39.112.gtf"
#GENE_VERSIONS=$(awk -F '[\t ;"]+' '/gene_id "(ENSMUSG00000019836|ENSMUSG00000020887)"/ {for (i=1; i<=NF; i++) if ($i=="gene_id") {gid=$(i+1)} else if ($i=="gene_version") {print gid"."$(i+1)}}' $GTF_FILE | sort | uniq | paste -sd "," -)
# The top part's for this code line (if there ever comes trouble with it): --miso_genes "$GENE_VERSIONS"
# Run Nextflow with your local rnasplice pipeline and include the mouse liver data
echo "Starting Nextflow pipeline..."
./nextflow run nf-core/rnasplice -resume -profile singularity \
--input /home/tud03125/pipeline/mouse_liver_2.csv \
--fasta /home/tud03125/pipeline/mm39.fa \
--gtf /home/tud03125/pipeline/mm39_RefSeq.gtf \
--save_reference \
--outdir "$OUTPUT_DIR" \
--star_index /home/tud03125/STAR_index_mouse_ucsc \
--salmon_index /home/tud03125/salmon_index_mouse_ucsc \
--rmats \
--rmats_novel_splice_site \
--suppa \
--contrasts /home/tud03125/pipeline/contrast_mouse_liver_2.csv
# Debugging: Print completion message and end timestamp
echo "Processing complete."
echo "Job ended on $(date)"
So, I started this Shell script, and I ran into this problem, currently:
ERROR ~ Error executing process > 'NFCORE_RNASPLICE:RNASPLICE:DEXSEQ_DEU:DEXSEQ_ANNOTATION (mm39_RefSeq.gtf)'
Caused by:
Process `NFCORE_RNASPLICE:RNASPLICE:DEXSEQ_DEU:DEXSEQ_ANNOTATION (mm39_RefSeq.gtf)` terminated with an error exit status (1)
Command executed:
dexseq_prepare_annotation.py mm39_RefSeq.gtf DEXSeq.gff
cat <<-END_VERSIONS > versions.yml
"NFCORE_RNASPLICE:RNASPLICE:DEXSEQ_DEU:DEXSEQ_ANNOTATION":
htseq: $(python -c "import pkg_resources; print(pkg_resources.get_distribution('htseq').version)")
END_VERSIONS
Command exit status:
1
Command output:
(empty)
Command error:
Traceback (most recent call last):
File "/home/tud03125/.nextflow/assets/nf-core/rnasplice/bin/dexseq_prepare_annotation.py", line 130, in <module>
raise ValueError("Same name found on two chromosomes: %s, %s" % (str(l[i]), str(l[i + 1])))
ValueError: Same name found on two chromosomes: <GenomicFeature: exonic_part 'Erdr1x' at chrY: 90827617 -> 90827734 (strand '+')>, <GenomicFeature: exonic_part 'Erdr1x' at chrX: 168793521 -> 168794059 (strand '+')>
Work dir:
/home/tud03125/pipeline/mouse_liver_rnasplice_UCSC/work/a7/c2272e12426b7d7b882261db579079
Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`
-- Check '.nextflow.log' file for details
Anyone had this issue before? I think I also attempted with GENCODE files and indexes too, and the error’s very similar to this.Michael Levin
10/26/2024, 2:58 AMEnsembl having unique gene_id based on loci, and "the other files" (including USCS I hope) are by gene_name instead, which could have multiple loci on that same gene_name. Their suggestion is 1) to stick with Ensembl or 2) to modify the script so that "This generates a 'unique' gene_id for the script by combining the chromosome number, gene name and strand information." Would that be the case here? Has anyone able to run rnasplice using other formats besides Ensembl, like USCS in this case?