Skip to content

Latest commit

 

History

History
210 lines (166 loc) · 5.52 KB

File metadata and controls

210 lines (166 loc) · 5.52 KB

HEADER 1

HEADER 2

HEADER 3

HEADER 4

HEADER 5

bold

  • List
    • list
    • list
    • list

HORIZONTAL RULE

Three or more...


Hyphens (---)


Asterisks (***)


Underscores (___)

SCRIPTS


#!/bin/bash

#SBATCH --job-name=star # Job name
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --time=60
#SBATCH --mem=32000 # Memory pool for all cores (see also --mem-per-cpu)
#SBATCH --partition=production
#SBATCH --reservation=workshop
#SBATCH --account=workshop
#SBATCH --array=1-16
#SBATCH --output=slurmout/star_%A_%a.out # File to which STDOUT will be written
#SBATCH --error=slurmout/star_%A_%a.err # File to which STDERR will be written

start=`date +%s`
echo $HOSTNAME
echo "My SLURM_ARRAY_TASK_ID: " $SLURM_ARRAY_TASK_ID

sample=`sed "${SLURM_ARRAY_TASK_ID}q;d" samples.txt`
REF="References/star.overlap100.gencode.v31"

outpath='02-STAR_alignment'
[[ -d ${outpath} ]] || mkdir ${outpath}
[[ -d ${outpath}/${sample} ]] || mkdir ${outpath}/${sample}

echo "SAMPLE: ${sample}"

module load star/2.7.0e

call="STAR
     --runThreadN 8 \
     --genomeDir $REF \
     --outSAMtype BAM SortedByCoordinate \
     --readFilesCommand zcat \
     --readFilesIn 01-HTS_Preproc/${sample}/${sample}_R1.fastq.gz 01-HTS_Preproc/${sample}/${sample}_R2.fastq.gz \
     --quantMode GeneCounts \
     --outFileNamePrefix ${outpath}/${sample}/${sample}_ \
     ${outpath}/${sample}/${sample}-STAR.stdout 2> ${outpath}/${sample}/${sample}-STAR.stderr"

echo $call
eval $call

end=`date +%s`
runtime=$((end-start))
echo $runtime


#!/bin/python
print 'one'
print 'two'

if x == 1:
    print 'one'

cond1 = True
cond2 = False
if cond1 and cond2:
    # do something
    

top.table$Gene <- rownames(top.table)
top.table <- top.table[,c("Gene", names(top.table)[1:6])]

top.table <- data.frame(top.table,anno[match(top.table$Gene,anno$Gene.stable.ID.version),],logcpm[match(top.table$Gene,rownames(logcpm)),])

write.table(top.table, file = "A.C_v_B.C.txt", row.names = F, sep = "\t", quote = F)
    

Embedding PDFs

This browser does not support PDFs. Please download the PDF to view it: Download PDF.

R CODE

  • run the alter_rmd.py script to change some of the R formatting.
python alter_rmd.py -i Intro2R.md
  • will produce a file with the same name Intro2R_fixed.md

BEFORE

# assign number 150 to variable a.
a <- 150
a
## [1] 150

AFTER

# assign number 150 to variable a.
a <- 150
a
[1] 150

TABLES FROM R

Description R_function
Mean mean()
Standard deviation sd()
Variance var()
Minimum min()
Maximum max()
Median median()
Range of values: minimum and maximum range()
Sample quantiles quantile()
Generic function summary()
Interquartile range IQR()

OUTPUT (VERY WIDE) (actually this is a file)

Taxon_Name MeanBootstrapValue MeanLengthMerged PercentageAsPairs Total d__Bacteria 0.997 421 0.0 126506 d__Bacteria;p__Acetothermia;c__Acetothermia_genera_incertae_sedis;o__Acetothermia_genera_incertae_sedis;f__Acetothermia_genera_incertae_sedis;g__Acetothermia_genera_incertae_sedis 0.56 421 0.0 1 d__Bacteria;p__Acidobacteria 0.605 424 0.0 1483 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp1 0.983 403 0.0 1049 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp10;o__Gp10;f__Gp10;g__Gp10 0.98 427 0.0 8312 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp11;o__Gp11;f__Gp11;g__Gp11 0.792 406 0.0 321 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp12;o__Gp12;f__Gp12;g__Gp12 0.999 403 0.0 34 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp13;o__Gp13;f__Gp13;g__Gp13 0.998 423 0.0 13 d__Bacteria;p__Acidobacteria;c__Acidobacteria_Gp15;o__Gp15;f__Gp15;g__Gp15 0.961 414 0.0 1356