This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fasta2oneline.sh | |
# Convert fasta file in one line: header[tab]sequence (useful for fastqc contaminant file, for example) | |
# Output to the stdout, redirect it to a file | |
# Usage: fast2oneline.sh x_example.fa > z_contaminants.txt | |
INPUT_FILE=$1 | |
cat ${INPUT_FILE} | sed '/^$/d' | sed -n '/^>/!{H;$!b};s/$/ \t/;x;1b;s/\n//g;p' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to send web request to MAKER channel in IFTTT.com. | |
# Arguments: | |
# $1: Event_name (this is the trigger for IFTTT and SHOULD BE configured in a IFTTT recipe in advance)) i.e: cluster_job | |
# $2: value1 (To be parsed as Maker variable, and be usable in the triggered event) OPTIONAL | |
# $3: value2 | |
# $4: value3 | |
# EXAMPLE | |
# Using recipe https://ifttt.com/recipes/301964 If Maker Event "mailto", then send an email to "value1" with subject "value2" and body "value3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### AMOVA between the three methylation types obtained by the package msap | |
# AMOVA requires a distance matrix between all samples. | |
# Such distance matrix could be only be built with quantitative data or with binary data. | |
# In the case of three category variables, we cannot set a distance between two samples | |
# (is distance between pattern I and III larger than between II and III?). | |
# This is why population studies of MSAP needs to join patterns II and III as methylated in order to | |
# build a binary variable to be analysed by AMOVA/PCoA. | |
# Anyway, we can made a hack *assuming that distance between different states is equal to 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
__author__="Andres Perez-Figueroa" | |
__date__ ="$14-jan-2016$" | |
__version_="2.0" | |
### Conversor from genepop to metapop | |
### Requires Biopython | |
### run: python g2m.py | |
### The program will ask for your datafile in genepop format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
#$ -j y | |
#$ -v LD_LIBRARY_PATH | |
# | |
####################################################### | |
# rEncodeFASTQ.sh | |
# | |
# A script to convert a gzipped FASTQ file in Solexa 1.3+ | |
# quality offset (QUAL+64 encoding) to a FASTQ with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Git clone all my gists | |
import json | |
import urllib | |
from urllib import urlopen | |
from subprocess import call | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming you have your aflp matrix data with samples in rows and | |
# loci in columns. The file is a csv file with the format of msap | |
#Read data | |
data <- read.csv("aflp.csv", header=TRUE) | |
#convert to matrix | |
matN <- as.matrix(data[,4:length(data[1,])]) | |
#Function for sannon index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Export PCoA plot in other formats" | |
output: html_notebook | |
--- | |
## Problem | |
Some users of the *msap* package could be interested in exporting plots (PCoA) in a format other than png. Currently this is not implemented in msap. | |
## Solution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "msap: tweak NJ plot" | |
output: html_notebook | |
--- | |
## Problem | |
The NJ plot form msap is awful, specially when the number of samples is big (>10). It was not intended to be very exahsutive, just as an exploratory analysis, but people seems to want to show it. | |
## Solution | |
We need to replot the NJ modifying the source code form msap. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Configuration file for Metapop2 | |
# This configuration file is an example of configuration file | |
# See full specification in https://github.com/anpefi/metapop2 or in the README.md file | |
# This file would run only the population analysis, skipping all the management | |
name = Test # Identification for this set of parameters. it will be included as part of results' filenames. Do not use withespaces | |
convert = none # Conversion of the input file to another format. It ignores the remaining configurations. [none/mtp2gp] | |
debug = false # Debug mode. Set true to print extra info. [true/false] | |
dec = 4 # Floating point precision |