Skip to content

Instantly share code, notes, and snippets.

View IdoBar's full-sized avatar

Ido Bar IdoBar

View GitHub Profile
@IdoBar
IdoBar / FastQC_aggregate.sh
Created July 16, 2017 23:12 — forked from danielecook/FastQC_aggregate.sh
Examine Fastqc reports in aggregate; brings images, statistics, and summaries together. #fastq
# Run this script in a directory containing zip files from fastqc. It aggregates images of each type in individual folders
# So looking across data is quick.
zips=`ls *.zip`
for i in $zips; do
unzip -o $i &>/dev/null;
done
fastq_folders=${zips/.zip/}
@IdoBar
IdoBar / putty-theme.reg
Created February 7, 2018 05:22
An improved Default Settings profile for PuTTY
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Colour0"="217,230,242"
"Colour1"="217,230,242"
"Colour2"="14,27,48"
"Colour3"="14,27,48"
"Colour4"="14,27,48"
"Colour5"="217,230,242"
"Colour6"="0,0,0"
@IdoBar
IdoBar / install_shiny_server.bash
Last active July 10, 2024 02:17
A script to install R, Rstudio and Shiny-server on an Ubuntu server
#! /bin/bash
# Ask user for sudo password (to be used when needed)
read -s -p "Enter Password for sudo: " sudoPW
# update CRAN repository below if needed
REPO="'https://cran.rstudio.com/'"
# Based on the instructions on Dean Attali's website:
# https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#user-libraries
@IdoBar
IdoBar / setup_nectar_teaching_server.md
Last active March 7, 2024 14:32
Setting up a NECTAR Cloud multi-user teaching server using conda

Setting up a cloud-based multi-user teaching server using conda

nectarcloud

Setup steps

  1. Apply for an allocation at NECTAR-RDS
  2. Setup 2 key-pairs (one will be for 'root-designated' login and the other for 'general-user' login), download the private keys to a secure location. If you're planning to use KiTTY or PuTTY to login to the server from Windows, you'll need to convert the .pem key file to a .ppk, as explained here. You can (and should) password-protect this key (can be done in PuTTYgen when converting the key from the default .pem format to a PuTTY-supported .ppk).
  3. Setup a customised security group to allow remote access (open port 22 for ssh logins and any addi
@IdoBar
IdoBar / fasta2agp.pl
Last active June 18, 2019 09:33
Fasta2APG
#!/bin/env perl
### [email protected]
### Generates contigs (in FastA) and scaffolding information (in AGP) from Velvet 'contigs.fa' supercontigs file
### Use entirely at you own risk!! There may be bugs!
### modified by [email protected] 2010/09/13
### add flags -i -size -o
@IdoBar
IdoBar / Italicize_species_Zotero.js
Last active January 26, 2020 12:02
Find species names (based on provided array of genus names) and add html tags for italics font
// See these instruction to enable js scripting in Zotero:
// https://forums.zotero.org/discussion/comment/324734/#Comment_324734
var fieldName = "title";
var plantsPathogens = ["Cryptobranchus", "Fusarium", "Mycosphaerella", "Pochonia", "Pogona", "Nannizziopsis", "Armillaria", "Parastagonospora", "Pseudoperonospora", "Phytophthora", "Heterobasidion", "Cochliobolus", "Rhynchosporium", "Aspergillus", "Ascochyta", "Sclerotinia", "Botrytis", "Cicer", "Lens","Oryza", "Eucalyptus", "Arabidopsis", "Vigna", "Phaseolus", "Vicia"];
var aquaticSpecies = ["Oreochromis", "Dicentrarchus", "Pagrus", "Gonostoma","Tursiops", "Gadus", "Danio", "Acanthosentis", "Oryzias", "Seriola", "Cyprinus", "Euthynnus", "Solea", "Nibea", "Thunnus thynnus","Argyrosomus", "Thunnus", "Misgurnus", "Oncorhynchus", "Epinephelus", "Rachycentron", "Clarias", "Tetraodon", "Proterocara", "Latimeria", "Oithona", "Sarda", "Glaucosoma", "Scomberomorus", "Allium", "Aulopus", "Plecoglossus", "Anguilla", "Hoplias", "Poecilia", "Sardinops", "Cyprinus", "A
@IdoBar
IdoBar / Zotero_make_species_great_again.py
Last active September 8, 2021 01:41
Italicize species names in Zotero titles
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 28 16:34:57 2020
@author: Ido Bar
"""
@IdoBar
IdoBar / blast_tax.md
Last active August 20, 2020 02:28
Use taxonomy and/or accession ids to restrict and distribute BLAST searches in an HPC cluster

Introduction

The following code snippets demonstrate an approach to substantially speed-up BLAST searches of large query files (whole transcriptomes/genomes) that are performed against the NCBI nr/nt/refseq databases by running small jobs annotating subsets of the input sequences against subsets of the databases.
The method is based on "divide and conquer" approaches [1–2] that split the search query and the database to multiple small jobs that require modest resources and time which can utilise high priority queues and are therefore ideal for an HPC setting. The exact number of jobs to be submitted is dependant on the specifics of the HPC cluster, primarily number of available nodes, queues limits and system loads and therefore need to be experimented for optimal results.

Requirements

The suggested script is tailored to run on the QRIS Awoonga HPC cluster, using [Conda environment](https://docs.conda.io/en/latest

@IdoBar
IdoBar / qstat
Last active January 10, 2021 16:09
A modified qstat wrapper to work with nextflow on QRIS Awoonga
#!/bin/bash
# put this file in $HOME/bin and make it executable
# make sure that this file is being called by default, I did this by adding `alias "qstat=~/bin/qstat"` to my ~/.bashrc
# Servers
#awoonga="@awongmgmr1.storage:16001 @awonmgr2.storage:16001"
#flashlite="@flm1.ipoib:16001 @flashmgr2.ipoib:16001"
#tinaroo="@tinmgmr1.ib0:16001 @tinmgr2.ib0:16001"
awoonga="@awonmgr2"
flashlite="@flashmgr2"
stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
# show_formula = TRUE,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,