Skip to content

Instantly share code, notes, and snippets.

View nylander's full-sized avatar

Johan Nylander nylander

View GitHub Profile
@nylander
nylander / gist:de0fe4f009314c1272523eb11a179910
Last active February 13, 2017 09:06
Pitfall in get_taxonids(), Bio::DB::Taxonomy
#!/usr/bin/perl
#===============================================================================
=pod
=head1
FILE: cgt.pl
USAGE: ./cgt.pl
DESCRIPTION: The intention of the original code was to search genbank
@nylander
nylander / extract_masked.pl
Created February 13, 2017 09:04
Extract masked positions in fasta file. Question on [biosupport.se](https://biosupport.se/p/327/)
#!/usr/bin/env perl
use strict;
use warnings;
=pod
=head1
FILE: extract_masked.pl
@nylander
nylander / acc2sci
Created November 21, 2017 08:12
Get taxonomy from genbank accessions
#!/bin/bash
## Fetch scientific name for Genbank accession number
## Version: Mon 20 nov 2017 13:35:49
## By: {Andreas.Kahari,Johan.Nylander}@nbis.se
## Usage: ./acc2sci.sh infile-with-accessions
## Notes: Reads from file or STDIN, prints to STDOUT.
## No detailed error checking! If any of the Accessions
## provided as queries are incorrect, the script will
## exit with msg: "Failure of post to find data to load.."
@nylander
nylander / db.fas
Last active December 3, 2020 09:23
Example files for blast
>PIS68081.1 anaerobic sulfatase maturase [Vibrio parahaemolyticus 1911C]
MQITQSPQFNGKASKRLHVMAKPIGAACNIDCTYCYYLSKQDLLEYKKGCSPMMDEATLEAYIKQYIEGQ
NTPEIVFSWQGGEPTMLGLDYFKKIVEFQAKYQPEGVKISNDLQTNGTLLNDEWCEFLSENHFLVGLSID
GPEMLHNAYRTNRAGRGTFKQVMNAVELLHKHQVNFATLTCVNNLTSRNPLEVYRFLRDEVRSPQMQFIP
IVEQKTFRTTAPQKWQPQEQLKQGDKRLIPGHKDSVMEPWCVADEAWGNFLIAVFDEWIKNDIGKVFVQY
FEASVEAWMGRANPLCTLGEVCGKGLAMEPNGDVFACDHYVYPEYKIGNIHHDKLDELAYSKEQQKFGFA
KSRLLTQQCRDCEYQFACYGECPKNRFIRTRDGEPGLNYLCAGWKKFFAHADKAMAYILRATGNVVAHGK
YSDSVVRQESEQRPVFETKF
>PIS68069.1 anaerobic sulfatase maturase [Vibrio parahaemolyticus 1911C]
MKDAYVRRFHVMAKPGGAKCNIDCQYCFYLHKENLLHQEKQPKMDDATLEAFVKSYIESQDGEEIVFSWQ
# gh-93: Repository surgery: Remove large files accidentally added in the past.
- Last modified: fre aug 09, 2019 12:34
- Sign: JN
## Description
Find large, unnecessary files in the MrBayes GitHub repository and delete them.
Saves approx. 132 MB of space (from 212 to 80 MB).
@nylander
nylander / restriction.nex
Created April 29, 2020 20:18
Example data of type "restriction" for MrBayes
#NEXUS
[Data from Table 1, Felsenstein, 1992, Evolution, 46(1),1992, pp. 159-173.]
Begin data;
Dimensions ntax=5 nchar=122;
Format datatype=restriction missing=?;
Matrix
Gibbon 11100000110001000010100111100000011100100100111110000001010001100100000000010000011010100111100011011010111111101101011001
Orang 11010110100111000000011000101010010000010101010010001000101000000011000000000010000111001110001000110011101001000111001110
Gorilla 11000101101001010111000001100001110011000000000010100000110100110001011000101011000010000101110000110000101101010110101000
Chimp 10000110100011111010000001000100110010101000000011000111100010110000100110000011100010001101100000110100001001010110111000
@nylander
nylander / gist:c55799686f71a008ec6ccdb37b8bfa5d
Created May 27, 2020 10:49
Alias for better jobinfo output on UPPMAX
# Bash alias for better jobinfo output on UPPMAX.
# Last modified: 2020-05-27
# Sign: Johan Nylander
# Include in your ~/.bash_aliases, and
# check that your ~/.bashrc reads your ~/.bash_aliases by, e.g.,
# including this in your ~/.bashrc:
# if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
# fi
#
@nylander
nylander / lw.dat
Last active February 9, 2021 20:51
My standard example data "lw": long-wave rhodopsin for a set of gall wasps (Cynipidae)
8 484
Barbotinia_oraniensis TCTTGGTCCATTTATATGTGAGATATATGCAATGCTTGGCTCCCTATTTGGATGTGGCTCCATTTGGACAATGTGTATGATTGCTTTCGACCGATACAATGTTATCGTAAAAGGTTTAGCTGGCAAGCCATTAACTATCAGTGGTGCAATTCTGCGTATTGTTTTTCTCTGGGTCTGGGCGGTAGTTTGGACCATTGCACCAATGATAGGATGGAATCGG---TACGTTCCCGAGGGCAACATGACAGCTTGTGGAACTGACTATCTAACTAAGGATTGGTTCTCGAGGTCTTACATTCTTGTATACAGCGTCTTCGTATACTTCATGCCACTTTTCCTCATCATCTACAGTTACTATTTCATCATTGCTGCTGTATCTGCTCATGAAAAAGCTATGCGTGAACAGGCCAAAAAGAWGAATGTAGCTTCTCTACGATCATCCGACAATCAAAATACGAGTGCTGAACATAAACTCGCCAAGGCA
Synergus_gallaepomiformis ACTAGGTCCATTTATATGTGAGATGTACGGAATGTTTGGCTCTCTATTCGGATGTGGTTCTATTTGGACAATGTGTATGATTGCTTTCGACCGATACAACGTTATCGTAAAAGGTTTAGTTGGCAAGCCCTTAACTATCAGTGGTGCAATCCTGCGCATTGCTTTTCTCTGGATCTGGGCAGTAATTTGGACAATCGCACCAATGATAGGATGGAATCGG---TACGTTCCGGAGGGTAACATGACAGCTTGCGGAACTGACTACCTGAGTAAGGATTGGTTCTCCAGGTCTTACATCATTGTATACAGCGTCTTTGTATACTTCATGCCACTTTTCCTCATCATATACAGTTACTACTTCATCATTGCTGCTGTATCTGCCCACGAGAAGGCTATGCGTGAACAGGCCAAAAAGATGAATGTAGCTTCTCTACGATCATCCGACAATCAAAATACGAGTGCTGAACATAAAC
@nylander
nylander / ptemplate
Created March 29, 2021 18:00
ptemplate - set up a project file hierarchy
#!/bin/bash
# ptemplate - Create a project structure
# Usage: ptemplate myproject
# Last modified: Mon mar 29, 2021 07:55
# Sign: Johan Nylander
# Description: Create a folder structure
# and, if git is available, initilize git-
# version control. No files in folder private
# is under git control, and only the README file
@nylander
nylander / fasta2nexus.pl
Created May 21, 2021 09:51
Fasta to Nexus converter using BioPerl
#! /usr/bin/env perl
#
# Short description for fasta2nexus.pl
#
# Author nylander <johan.nylander@nrm.se>
# Version 0.1
# Copyright (C) 2021 nylander <johan.nylander@nrm.se>
# Modified On 2021-05-21 10:54
# Created 2021-05-21 10:54
#