Skip to content

Instantly share code, notes, and snippets.

@sashaphanes
Created August 13, 2013 13:27
Show Gist options
  • Save sashaphanes/6221050 to your computer and use it in GitHub Desktop.
Save sashaphanes/6221050 to your computer and use it in GitHub Desktop.
extract specific gene expression data from the ABA RNA-Seq BrainSpan Matrix
$ perl extract.data.pl GENESYMBL 2 |perl -ne '{chomp; $row++; @cols = split (/\t/, $_); $colNo = 0; foreach $data (@cols) {$colNo++; $h{$colNo}{$row} = $data; } if (eof) { foreach $colNo (sort {$a<=>$b} keys %h) { $newRow =""; foreach $row (sort {$a<=>$b} keys %{$h{$colNo}} ) {$data = $h{$colNo}{$row}; $newRow .="$data\t"; } $newRow =~ s/\t$//; print "$newRow\n"; } } }' |sed 's/"//g' >gene.data/GENESYMBL.txt; paste sample.info.txt gene.data/GENESYMBL.txt >gene.data/GENESYMBL.data; rm gene.data/GENESYMBL.txt; cut -f4 gene.data/GENESYMBL.data >gene.data/GENESYMBL.val;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment