Skip to content

Instantly share code, notes, and snippets.

View ropolomx's full-sized avatar
🐝

Rodrigo O. Polo ropolomx

🐝
  • Agriculture and Agri-Food Canada
  • Canada
View GitHub Profile

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
conda env export --no-builds
@ropolomx
ropolomx / extract_fasta_samtools.sh
Created April 12, 2019 01:43
Extract sequences from FASTA file by name
samtools faidx Trinity.fasta -r PL_transcript_id.csv > PL_extract.fasta
@ropolomx
ropolomx / colors.csv
Created March 31, 2019 04:40 — forked from lokeb/colors.csv
Color names with Hex Code obtained from https://en.wikipedia.org/wiki/List_of_colors:_A%E2%80%93F
Name Hex Code
Absolute Zero #0048BA
Acid #B0BF1A
Acid green #B0BF1A
Aero #7CB9E8
Aero blue #C9FFE5
Air superiority blue #72A0C1
Alabama crimson #AF002A
Alabaster #EDEAE0
Alice blue #F0F8FF
@ropolomx
ropolomx / qiime_manifest.sh
Last active February 4, 2019 19:03
Create QIIME manifest in command line
# Send filenames to manifest file
ls *.fastq.gz > manifest.txt
# Duplicate first column and add comma separation
awk -F',' '{$1=$1","$1}1' OFS=',' manifest.txt > tmp && mv tmp manifest.txt
# If necessary remove text information from first column in Vim visual mode
#!/usr/bin/env python3
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
import sys
gbank = SeqIO.parse(open(sys.argv[1], "r"), "genbank")
output_handle=open("rRNAs.fa","w")
rRNAs = []
for genome in gbank :
import os
import glob
SAMPLE = ['FC-F1', 'FC-H1', 'FC-I1']
FWD = expand('{sample}/{sample}_unmapped_fwd.fastq', sample=SAMPLE)
REV = expand('{sample}/{sample}_unmapped_rev.fastq', sample=SAMPLE)
rule all:
input:
@ropolomx
ropolomx / nullarbor_sample_files.sh
Last active October 24, 2018 00:09
Prepare sample files for Nullarbor
# send file names of R1s to a file
ls *_R1_001.fastq.gz > samples.tab
# depending on which version of awk/gawk we can do inplace changes
awk -F'\t' '{$1=$1"\t"$1}1' OFS='\t' samples.tab > tmp && mv tmp samples.tab
# Extract sample name
sed -i 's/\([0-9+]\)\([A-Z+]\).*\.fastq\.gz\t/\1\2\t/g' samples.tab
# Copy file names
@ropolomx
ropolomx / kraken.smk
Created May 25, 2018 19:55
Snakefile for running Kraken
import os
import glob
KRAKEN_DB = 'fmdv_kraken_db'
FILTER = ["0.05","0.2"]
SAMPLE = [os.path.basename(f).split('_')[0] for f in glob.glob('../fmdv_fastq/*_1_*.fastq')]
rule all:
@ropolomx
ropolomx / make_amr_analytic_matrix.R
Last active May 25, 2018 17:59
Create analytic matrix from AMR Plus Plus results
# Load packages -----------------------------------------------------------
library(tidyverse)
# library(stringr)
# Need to load if using tidyverse version 1.1.1. Not necessary to load separately if using tidyverse 1.2.1
library(here)