Skip to content

Instantly share code, notes, and snippets.

@andrawaag
andrawaag / gist:5270250
Created March 29, 2013 11:13
matlab example
a= 43;
If (a > 34) then
m=”1”;
elseif (a<3) then
m=”2”;
elseif (a<=34) then
m=”3”; else
m=”4”;
@andrawaag
andrawaag / CizarExample
Created May 7, 2013 12:21
Korte beschrijving
# Create subject and identify them with family URI
adam = familyUri["adam"]
beth = familyUri["beth"]
chuck = familyUri["chuck"]
dotty = familyUri["dotty"]
edward = familyUri["edward"]
fran = familyUri["fran"]
greg = familyUri["greg"]
harriet = familyUri["harriet"]
@fruit = ("apple", "banana", "orange", "kiwi");
print $fruit[0]."\n";
print $fruit[1]."\n";
print $fruit[2]."\n";
print $fruit[3]."\n";
@fruit = ("apple", "banana", "orange", "kiwi");
foreach (@fruit) {
print $_."\n";
}
%fruitcolor = ("apple", "red", "banana", "yellow", "orange", "orange", "kiwi", "brown");
print $fruitcolor{"apple"}."\n";
print $fruitcolor{"banana"}."\n";
print $fruitcolor{"orange"}."\n";
print $fruitcolor{"kiwi"}."\n";
%fruitcolor = ("apple", "red", "banana", "yellow", "orange", "orange", "kiwi", "brown");
while (($key, $value) = each(%fruitcolor)){
print "A ". $key." is ".$value."\n";
}
open EXPRESSIONFILE, "N:/FHML_BIGCAT/Bioinformatics/Programming/GeneExpression.txt";
while ($line = <EXPRESSIONFILE>){
@fields = split('\t', $line);
print $fields[9]."\n";
}
@andrawaag
andrawaag / gist:5689819
Created June 1, 2013 09:37
BGKMLW25_task7.pl
open EXPRESSIONFILE, "N:/FHML_BIGCAT/Bioinformatics/Programming/GeneExpression.txt";
while ($line = <FILE>){
@fields = split('\t', $line);
if ($fields[2]<0){
print $line;
}
}
open EXPRESSIONFILE, "N:/FHML_BIGCAT/Bioinformatics/Programming/GeneExpression.txt";
$counter = 0;
while ($line = <FILE>){
@fields = split('\t', $line);
if ($fields[2]<0){
$counter = $counter + 1;
}
}
print $counter;
open DISEASEGENEFILE, "N:/FHML_BIGCAT/Bioinformatics/Programming/mart.txt";
open EXPRESSIONFILE, "N:/FHML_BIGCAT/Bioinformatics/Programming/GeneExpression.txt";;
%disease = {};
while($line = <DISEASEGENEFILE>){
@fields = split(/\t/, $line);
if ($fields[2] ne ''){
$disease{$fields[0]} = $fields[2];
}
}