1. Create a bucket

  2. Upload read files and genome index to bucket using the gcloud CLI sdk if your files are stored locally

  3. Create a VM with your compute needs

  4. Connect to the VM from terminal

    gcloud compute ssh --project=<project> --zone=<zone> <instance name>
    
  5. Transfer reads and genome index to VM using gcloud

    gcloud storage cp --recursive gs://BUCKET_NAME/OBJECT_NAME SAVE_TO_VM_LOCATION
    
  6. Meanwhile, download the STAR aligner to your VM

    1. Download binaries using instructions on Github: https://github.com/alexdobin/STAR

      wget <https://github.com/alexdobin/STAR/archive/2.7.11b.tar.gz>
      tar -xzf 2.7.11b.tar.gz
      cd STAR-2.7.11b
      
    2. Add STAR to path

      echo "export PATH=$PATH:/home/timon/STAR-2.7.11b/bin/Linux_x86_64_static" >> ~/.bashrc
      source ~/.bashrc
      STAR
      
    3. Install libgomp1

      sudo apt-get install libgomp1
      
  7. Align reads using

    STAR --runThreadN 8 \\
    --runMode alignReads \\
    --genomeDir genome-index/ \\
    --readFilesIn SRR22875020/SRR22875020_1.fastq \\
    --outWigType wiggle \\
    --outSAMtype BAM SortedByCoordinate \\
    --limitBAMsortRAM 1174874044
    

Troubleshooting


EXITING because of FATAL ERROR: could not open genome file genome-index//genomeParameters.txt
SOLUTION: check that the path to genome files, specified in --genomeDir is correct and the files are present, and have user read permsissions

Apr 17 11:11:39 ...... FATAL ERROR, exiting