Skip to content

Instantly share code, notes, and snippets.

💭
Organising stuff in repos

Joseph Hughes josephhughes

💭
Organising stuff in repos
Block or report user

Report or block josephhughes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josephhughes
josephhughes / Clusters.txt
Created Oct 7, 2015
Generating a circular plot showing reassortment using the ETE toolkit
View Clusters.txt
#Name Seg1 Seg2 Seg3 Seg4 Seg5 Seg6 Seg7 Seg8 Seg9 Seg10
1-8FRA2008-27 15 4 16 1 11 3 1 19 1 14
1-8FRA2008-28 15 4 16 1 11 3 1 19 1 14
1-8FRA2008-29 15 4 16 1 11 3 1 19 1 14
10RSArrrr-10 ? ?
11RSArrrr-11 15 6
12RSArrrr-12 ? ?
13RSArrrr-13 ? ?
14CAR1982-04 ? ? 1 1 1 ? ? 2 1 1
14POL2012-01 3 14 15 2 2 13 5 7 4 14
@josephhughes
josephhughes / RetrieveEmailFromPubmed
Created Oct 13, 2014
A perlscript to parse the email addressed from the affiliations in PubMed
View RetrieveEmailFromPubmed
#!/usr/bin/perl -w
# A perlscript written by Joseph Hughes, University of Glasgow
# use this perl script to parse the email addressed from the affiliations in PubMed
use strict;
use LWP::Simple;
my ($query,@queries);
#Query the Journal of Virology from 2014 until the present (use 3000)
$query = 'journal+of+virology[journal]+AND+2014[Date+-+Publication]:3000[Date+-+Publication]';
@josephhughes
josephhughes / dna2FreqAndDistMat
Last active Dec 20, 2015
Generate a set of unique sequences from a fasta file and return the frequency of each unique sequence and a pairwise distance of the sequences using the dist.dna function from ape. The default distance model used in "raw" but all models available in dist.dna can be specified. Sequences that have ? or - will be considered different.
View dna2FreqAndDistMat
require(ape)
dna2FreqAndDistMat<-function(dna,model=NULL){
if(is.null(model)){ model <- c("raw")}
#model must be one , "raw" is the default model
allowed_models<-c("raw", "N", "TS", "TV", "JC69", "K80", "F81", "K81", "F84", "BH87", "T92", "TN93", "GG95", "logdet", "paralin", "indel", "indelblock")
if(!any(allowed_models==model)){
warning("You need to provide the correct model: raw, N, TS, TV, JC69, K80, F81, K81, F84, BH87, T92, TN93, GG95, logdet, paralin, indel, indelblock")
return(NULL)
}
@josephhughes
josephhughes / parse_cdhit.pl
Created Jan 17, 2013
Use this script to get the number of reads in each cluster
View parse_cdhit.pl
# use this to get the number of reads in each cluster
use strict;
use Getopt::Long;
use Bio::SeqIO;
my ($clstr,$result,$long,%clusters,$infile);
&GetOptions(
'clstr:s' =>\$clstr, #a cd-hit generated cluster file
'out:s' => \$result, # a text file with the numbers of reads in each cluster
);
@josephhughes
josephhughes / ReplaceStopWithRefCodonGaps.pl
Created Jan 17, 2013
use this to remove stop codons from an alignment typically, this would be done to calculate dN/dS in HYPHY Usage: perl ../Scripts/ReplaceStopWithGaps.pl -pep 104D5_pep.fasta -nuc 104D5.fasta -output 104D5_nostop.fasta -ref 104D5S1 use this to replace stop codons from the nucleotide alignment with the codon of the reference the nucleotide and the…
View ReplaceStopWithRefCodonGaps.pl
#!/usr/bin/perl -w
#
# use this to remove stop codons from an alignment
# typically, this would be done to calculate dN/dS in HYPHY
# Usage: perl ../Scripts/ReplaceStopWithGaps.pl -pep 104D5_pep.fasta -nuc 104D5.fasta -output 104D5_nostop.fasta -ref 104D5S1
# use this to replace stop codons from the nucleotide alignment with the codon of the reference
# the nucleotide and the peptide alignments are necessary and the name of the reference sequence
# the reference sequence needs to be in the nucleotide alignment
@josephhughes
josephhughes / README
Last active Sep 26, 2015
Use this script to replace the stop codons with gaps in the nucleotide alignment
View README
ReplaceStopsWithGaps.pl is a perlscript written by Joseph Hughes, University of Glasgow
use this to remove stop codons from an alignment
typically, this would be done to calculate dN/dS in HYPHY
Usage:
perl ../Scripts/ReplaceStopWithGaps.pl -pep 104D5_pep.fasta -nuc 104D5.fasta -output 104D5_nostop.fasta
use this to replace stop codons from the nucleotide alignment
the nucleotide and the peptide alignments are necessary
@josephhughes
josephhughes / README
Created Aug 24, 2011
Perl script to split a file containing multiple fastq into separate fast files names according to the fast ID
View README
SplitFastq.pl is a perlscript written by Joseph Hughes, university of Glasgow
Usage:
perl SplitFastq.pl -in ourmultifastqfile
This script will split a file containing multiple fastq into separate fast files names according to the fast ID.
The script uses Bioperl.
You can’t perform that action at this time.