#P. citri all data (VF+MF susphire and Edinburgh all Pcitri samples) ulimit -n 32000 ##mapping reads back to rnaSPAdes assembly using STAR to check the percentage of reads that map cd /DATA/markop/Pcitri_rnaspades_alldata mkdir star_index #the soft filtered file was used as a reference STAR --runThreadN 32 --runMode genomeGenerate --genomeDir ./star_index --genomeFastaFiles ./output/soft_filtered_transcripts.fasta --limitGenomeGenerateRAM=220000000000 mkdir STAR_mapToAssembly #this command doesn't work because you cannot have paired and single end reads in same mapping!!! #also with multiple PE samples separated with comma I get a Segmentation fault error :( will do each sample separately # STAR \ # --runMode alignReads \ # --runThreadN 32 \ # --genomeDir ./star_index \ # --readFilesCommand gzip -c \ # --readFilesIn \ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S1_VF_2_GGAAGAGA-CGAGAGAA_L007_R1_trimmed_paired.R1.fastq.gz \ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S1_VF_2_GGAAGAGA-CGAGAGAA_L007_R1_trimmed_paired.R2.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S1_VF_2_GGAAGAGA-CGAGAGAA_L007_R1_trimmed_orphans.R1.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S2_VF_3_TCGGATTC-CGCAACTA_L007_R1_trimmed_paired.R1.fastq.gz \ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S2_VF_3_TCGGATTC-CGCAACTA_L007_R1_trimmed_paired.R2.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S2_VF_3_TCGGATTC-CGCAACTA_L007_R1_trimmed_orphans.R1.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S3_VF_5_CTGTACCA-CACAGACT_L007_R1_trimmed_paired.R1.fastq.gz \ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S3_VF_5_CTGTACCA-CACAGACT_L007_R1_trimmed_paired.R2.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S3_VF_5_CTGTACCA-CACAGACT_L007_R1_trimmed_orphans.R1.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S4_VF_6_GAGAGTAC-TGGAAGCA_L007_R1_trimmed_paired.R1.fastq.gz \ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S4_VF_6_GAGAGTAC-TGGAAGCA_L007_R1_trimmed_paired.R2.fastq.gz,\ # /FITO_ws/markop/pcitri_trimmed/PRO1976_S4_VF_6_GAGAGTAC-TGGAAGCA_L007_R1_trimmed_orphans.R1.fastq.gz \ # --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR \ # --outSAMtype BAM SortedByCoordinate \ # --outReadsUnmapped Fastx # default --outFilterMultimapNmax 20 ##mapping only paired reads #ulimit default 1024 ulimit -n 10000 mkdir STAR_mapToAssembly #load genome STAR --genomeLoad LoadAndExit --genomeDir ./star_index #SUSPHIRE_VF1 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_02_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_02_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF02_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_VF2 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_03_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_03_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF03_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_VF3 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_05_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_05_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF05_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_VF4 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_06_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/VF_06_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF06_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_MF1 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_08_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_08_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF08_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_MF2 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_09_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_09_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF09_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_MF3 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_10_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_10_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF10_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #SUSPHIRE_MF4 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_11_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2018_mpe_Pcitri/data/MF_11_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF11_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #*** #Edinburgh_ALL1 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_ALL_1_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_ALL_1_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EALL1_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_F1 STAR \ --runMode alignReads \ --runThreadN 6 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_1_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_1_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF1_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_F2 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_2_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_2_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF2_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_F3 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_3_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_F_3_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF3_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_M1 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_1_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_1_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM1_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_M2 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_2_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_2_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM2_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #Edinburgh_M3 STAR \ --runMode alignReads \ --runThreadN 32 \ --genomeDir ./star_index \ --readFilesIn \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_3_1.fastq.gz \ /NFSs-datarepo/ngs_omics/NGS_pci_rna-seq_2019_mpe_SUSPHIRE-Edinburgh/data/PC_M_3_2.fastq.gz \ --outFileNamePrefix ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM3_ \ --outSAMtype BAM SortedByCoordinate \ --readFilesCommand pigz -c -d #unload genome STAR --genomeLoad Remove --genomeDir ./star_index ##### we also want to count the reads that are mapped to each transcript and perform DE analysis in R (limma-voom) #index bam files samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EALL1_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF10_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM2_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM1_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF05_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF09_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF06_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF3_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM3_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF02_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF08_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF11_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF2_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF03_Aligned.sortedByCoord.out.bam samtools index -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF1_Aligned.sortedByCoord.out.bam #### get counts with samtools idxstats samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EALL1_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EALL1.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF10_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF10.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM2_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM2.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM1_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM1.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF05_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF05.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF09_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF09.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF06_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF06.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF3_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF3.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM3_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EM3.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF02_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF02.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF08_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF08.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF11_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SMF11.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF2_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF2.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF03_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_SVF03.counts samtools idxstats -@ 6 ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF1_Aligned.sortedByCoord.out.bam > ./STAR_mapToAssembly/Pcitri_mapToAssembly_STAR_EF1.counts #run R to combine all counts in to an expression matrix -> did it localy on my disk D:\SUSPHIRE\Pcitri\Pcitri_rnaspades_alldata