Skip to content

Instantly share code, notes, and snippets.

View MADscientist314's full-sized avatar
💻
learning

Michael J. MADscientist314

💻
learning
  • Baylor College of Mediciine
  • Houston, Tx
View GitHub Profile
@MADscientist314
MADscientist314 / fastqscreener.sh
Created April 28, 2021 20:02
fastqscreener wrapper
threads=48
for n in $(cat manifest_02);
do
nohup fastq_screen
time
fastq_screen \
--nohits \
--threads $threads \
--subset 0 \
@MADscientist314
MADscientist314 / add_filename_column.sh
Last active December 9, 2020 17:38
append the filename to the first column of every file in a directory
for i in *;
do
#practice (wont overwrite the file
nawk '{print FILENAME"\t"$0}' $i > $i.bk; mv $i.k $i;
#will overwrite the file
#nawk '{print FILENAME"\t"$0}' $i > $i.bk; mv $i.bk $i;
done
@MADscientist314
MADscientist314 / xargsync.sh
Created November 2, 2020 17:08
execute a parallel rsync with xargs for large data transfers
#!/bin/bash
# Parallel rsync script originally designed for rsyncing
# large ata transfers from RAID to RAID for the Aagaard Lab.
# Author: Michael Jochum
# Location: Baylor College of Medicine, Houston, TX, USA
# Contact : michael.jochum@bcm.edu
# Date : 2 November 2020
##################################
#Step 0: fill this shit out
### RScript to go along with the tutorial found here: https://astrobiomike.github.io/amplicon/dada2_workflow_ex
library(dada2)
packageVersion("dada2") # 1.11.5 when this was put together
setwd("~/dada2_amplicon_ex_workflow")
list.files() # make sure what we think is here is actually here
docker run -it -v $PWD:$PWD --name blast_nt ncbi/blast
update_blastdb.pl --showall [*]
#cd /media/jochum00/Aagaard_Raid/reference_datasets/ncbi_db
#mkdir nt
#cd nt
update_blastdb.pl --decompress --source gcp --verbose --verbose nt
export BLASTDB=/media/jochum00/Aagaard_Raid/reference_datasets/ncbi_db/nt
blastn \
@MADscientist314
MADscientist314 / fastq_to_fasta.sh
Created June 12, 2020 19:25
Fastq to fasta variable loop
for n in $(cat list);
do
echo "converting $n fastq.gz to fasta";
seqtk seq -a $n\_kneaddata_paired_1.fastq.gz > $n\_kneaddata_paired_1.fasta;
seqtk seq -a $n\_kneaddata_paired_2.fastq.gz > $n\_kneaddata_paired_2.fasta;
done
@MADscientist314
MADscientist314 / 1_qiime_part.sh
Last active October 16, 2019 15:44 — forked from erictleung/1_qiime_part.sh
Updated QIIME2 to Phyloseq Code for qiime2-2019.7 version syntax. Orignally derived from https://github.com/joey711/phyloseq/issues/821#issuecomment-371701469
# ---
# title: Export QIIME2 OTU table to compatible file for phyloseq
# description: |
# Three main steps to get to compatible file to import to phyloseq
#
# Outline:
# 1. Export OTU table
# 2. Export taxonomy table
# 3. Export phylogenetic tree
# ---