#Move to RNAseq folder
cd 2.RNASeq_practice/
ls

#move to the reference directory and check files
cd 0.Reference
ls

#reference indexing
/home/Program/hisat2-2.0.0-beta/hisat2-build EquCab2_Chr3.fa EquCab2_Chr3


#move to the raw data directory and check files
cd ../1.Raw_data/
ls

#trimmomatic
java -jar /home/Program/Trimmomatic-0.35/trimmomatic-0.35.jar PE -phred33 \
BF1B_chr3_1.fastq.gz BF1B_chr3_2.fastq.gz ../2.Trimmed_data/BF1B_chr3_1_paired.fastq \
../2.Trimmed_data/BF1B_chr3_1_unpaired.fastq ../2.Trimmed_data/BF1B_chr3_2_paired.fastq ../2.Trimmed_data/BF1B_chr3_2_unpaired.fastq \
ILLUMINACLIP:/home/Program/Trimmomatic-0.35/adapters/TruSeq3-PE-2.fa:2:30:10 MINLEN:75


#move to the trimm output directory and check files
cd ../2.Trimmed_data/
ls

#Run hisat2
/home/Program/hisat2-2.0.0-beta/hisat2 -p 1 -x ../0.Reference/EquCab2_Chr3 -1 BF1B_chr3_1_paired.fastq -2 BF1B_chr3_2_paired.fastq| /home/Program/samtools-1.2/samtools view -Sbo BF1B_chr3.bam -


#Run Sam Sorting
/home/Program/samtools-1.2/samtools sort -n BF1B_chr3.bam ../3.Sorted_Bam/BF1B_chr3_Sorted


#move to the sorted bam directory and check files
cd ../3.Sorted_Bam/
ls

#HTseq to retrieve the counts
python -m HTSeq.scripts.count -f bam --stranded=no BF1B_chr3_Sorted.bam ../0.Reference/EquCab2_Chr3.gtf > ../4.HTseq_count/BF1B_chr3_Count.txt


#move to the sorted bam directory and check files
cd ../4.HTseq_count/
ls

### for R analysis, move on to the next directory that contains simulated count files
### R을 실행할때 이 폴더에서 실행하셔야 합니다. 아래코드를 마지막에 꼭 돌려주세요.
cd ../5.HTseq_simulated/
ls