Skip to content

Instantly share code, notes, and snippets.

View MVesuviusC's full-sized avatar

Matt Cannon MVesuviusC

View GitHub Profile
@MVesuviusC
MVesuviusC / R_package_install_fail.txt
Last active January 13, 2025 16:29
Error installing R packages on Franklin cluster
install.packages("ggpubr")
.
.
.
.
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking for g++ -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
@MVesuviusC
MVesuviusC / ggvenn_fix
Created January 30, 2023 21:22
Fix ggvenn labels getting cut off
venn_plot <- ggvenn::ggvenn(list_of_four_vectors)
venn_plot$layers[[3]]$data$x <- c(-1, -0.8, 0.8, 1)
@MVesuviusC
MVesuviusC / maint_time.txt
Last active October 23, 2023 15:03
get time till next maintenance on the HPC
get_maint_time () {
maint_start=$(scontrol show -u root reservation \
| perl -pe 's/\n/#/g' \
| perl -pe 's/#ReservationName=/\n/g' \
| grep MAINT \
| perl -ne '/.+StartTime=(.+)\sEndTime/; print $1;')
difftime=$(($(date +%s -d "$maint_start") - $(date +%s) - 1000))
req_len=$(date -d "@$difftime" "+$(($difftime/86400))-%H:%M:%S")
echo $req_len
}
@MVesuviusC
MVesuviusC / find_chmod.txt
Created December 13, 2022 14:39
Find by user and permissions and chmod
# find and chmod files that aren't 444 in a couple directories
for directory in BCLs FASTQs Counts
do
find \
/home/gdrobertslab/lab/${directory} \
-user mvc002 \
-type f \
-not -perm 444 \
| xargs \
-d '\n' \
@MVesuviusC
MVesuviusC / id_illumina.txt
Created December 2, 2022 20:52
ID illumina instrument
InstrumentIDs = {"HWI-M[0-9]{4}$" : ["MiSeq"],
"HWUSI" : ["Genome Analyzer IIx"],
"M[0-9]{5}$" : ["MiSeq"],
"HWI-C[0-9]{5}$" : ["HiSeq 1500"],
"C[0-9]{5}$" : ["HiSeq 1500"],
"HWI-D[0-9]{5}$" : ["HiSeq 2500"],
"D[0-9]{5}$" : ["HiSeq 2500"],
"J[0-9]{5}$" : ["HiSeq 3000"],
"K[0-9]{5}$" : ["HiSeq 3000","HiSeq 4000"],
"E[0-9]{5}$" : ["HiSeq X"],
@MVesuviusC
MVesuviusC / R_on_GPU.txt
Last active September 30, 2022 16:33
running R on a GPU node
Instructions taken from: https://clint.id.au/?p=1900
srun -c 4 --gres=gpu --account=gdrobertslab --x11 --pty bash
echo "NVBLAS_LOGFILE nvblas.log
NVBLAS_CPU_BLAS_LIB /usr/local/cuda-11.6/lib64/libnvblas.so
NVBLAS_GPU_LIST ALL" > ~/nvblas.conf
module load CUDA/11.5.0
@MVesuviusC
MVesuviusC / scron_jobs.txt
Last active June 12, 2023 12:27
scron jobs
# List scron jobs
scrontab -l
#Edit scron job
scrontab -e
# If scrontab get disabled
scrontab -e
# Delete #DISABLED.... up until $SCRON
@MVesuviusC
MVesuviusC / rstudio_sing.txt
Created April 19, 2022 13:22
rstudio server using singularity
singularity rstudio
modified from: https://www.rocker-project.org/use/singularity/
#!/bin/bash
#SBATCH --time=3-00:00:00
#SBATCH --signal=USR2
#SBATCH --ntasks=1
module purge
@MVesuviusC
MVesuviusC / xargs.txt
Created April 19, 2022 13:21
xargs bits
samtools view -H yourFile.bam | \
grep "\@SQ" | \
sed 's/^.*SN://g' | \
cut -f 1 | \
xargs -I {} \
-n 1 \
-P 24 \
sh -c "samtools mpileup -BQ0 -d 100000 -uf yourGenome.fa -r {} yourFile.bam | bcftools view -vcg - > tmp.{}.vcf"
@MVesuviusC
MVesuviusC / dnanexus_app_build.txt
Created April 19, 2022 13:20
DNAnexus app building
DNAnexus app building
source ~/virtualEnvs/dnanexus/bin/activate
dx login # login to server, choose which project to attach to
dx build # build app from the json and associated file(s)
deactivate