Skip to content

Instantly share code, notes, and snippets.

View ascatanach's full-sized avatar

Andrew Catanach ascatanach

  • Plant and Food Research
  • Lincoln, New Zealand
View GitHub Profile
@ascatanach
ascatanach / awk_make_windows
Last active November 25, 2021 22:10
bedtools makewindows using awk
for i in {0..9000000..1000000}
do
echo -e "$i" | awk -v OFS="\t" 'BEGIN { FS = "," } ;{print "chr25",$1,$1+1000000}'
done > 00.data/windows.bed
@ascatanach
ascatanach / MISA_and_primer3.md
Last active July 5, 2022 09:26
MISA and primer3 input and output scripts with primer3 versions 2.2.3 and 2.3.5.

Use of uninitialized value $total in concatenation (.) or string at misa.pl line 224, chunk 99., means the conditions in the ini file are too stringent

Problem: MISA and the associated scripts from Thomas Thiel and available at http://pgrc.ipk-gatersleben.de/misa/ were written for use with early versions of primer3. These work with primer3 version 1.1.1 (and likely others), however, later versions (2.2.3 and 2.3.5 anyway) throw an error such as
Use of uninitialized value $count in concatenation (.) or string at ./p3_out.pl line 76, <SRC> chunk 11.
These come from later versions of primer3 using different input tags.

Solutions: 2.2.3 accepts the switch -io_version=3 which invokes the use of an old set of input tags and should fix the problem. 2.3.5 does not accept -io_version=3 so a more involved workaround is required. A primer3 settings file is required, called using the switch -p3_settings_file=<file>, which contains the following:

@ascatanach
ascatanach / R_Kernel_install.md
Last active March 15, 2016 21:12
Installing R Kernel for Jupyter (Ubuntu VM on VirtualBox)
@ascatanach
ascatanach / extract_seqs_from_id_file.pl
Created March 5, 2015 21:00
Perl script to extract a subset of a fasta file of sequences listed in an id file
#!/usr/bin/perl -w
#adapted from Neilfws at https://www.biostars.org/p/2822/
#perl script to extract a subset of a fasta file of sequences listed in an id file
#NB The output needs a little edting, place the first ">" and remove the last.
#ids only up to first white space
use strict;
@ascatanach
ascatanach / sed_del_hard_return
Last active August 29, 2015 14:16
Remove hard returns
%%bash
cat infile | sed 's/\r$//' > temp
mv temp infile
@ascatanach
ascatanach / tr_to_del_newlines
Created March 5, 2015 02:51
Using tr to get rid of new lines
tr '\n' ' ' < input_filename
@ascatanach
ascatanach / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console