#Running STAR. Sample: sample_id | xthreads   
#Script run for each sample, base edits to commands can be made to this file and then recall "/home/asiimwe/projects/run_env/alpha_star_wasp_comparison/STAR_Run_Dirs.py"
#Replacements per run are made to: sampleid, threads,  and the  vcf files per call
#Directory STAR_Runs needs to be created prior to running the python file


#All FASTQ files are in: /scratch/asiimwe/STAR-WASP_forRebecca/FASTQ

#All VCF files are in: scratch/asiimwe/STAR-WASP_forRebecca/VCF

#Note sample HG00514 is  missing its vcf file


STAR=/usr/bin/STAR
baseFileDir="/scratch/asiimwe/STAR-WASP_forRebecca/FASTQ"
vcfFileDir="/scratch/asiimwe/STAR-WASP_forRebecca/VCF"
ulimit -n 10000

STARpar="--runThreadN x --genomeDir /home/asiimwe/projects/run_env/alpha_star_wasp_comparison/genome_directory/  --genomeLoad NoSharedMemory --outSAMtype BAM SortedByCoordinate --outSAMattributes NH HI AS nM NM MD jM jI rB MC vA vG vW --waspOutputMode SAMtag  --alignEndsType EndToEnd --outSAMunmapped Within --outFilterMultimapNmax 1"

STARreads="--readFilesCommand gunzip -c --readFilesIn $baseFileDir/sample_id/R1.fastq.gz  $baseFileDir/sample_id/R2.fastq.gz"

STARvcf="--varVCFfile $vcfFileDir/ssd.vcf"


$STAR $STARpar $STARreads $STARvcf

#/usr/bin/time -v -o STAR_HG00512_16threads_resource_log.txt BaseCode_STAR_Runs.sh



