Wednesday, October 24, 2007

Abertura Facil

Afinal não sou o unico a ter um problema com embalagens de "abertura facil".

Tuesday, October 09, 2007

Freedom (I still think this is the end of the record industry)


08 october 2007: big news
hello everyone. i've waited a long time to be able to make the
following announcement: as of right now nine inch nails is a totally
free agent, free of any recording contract with any label. i have
been under recording contracts for 18 years and have watched the
business radically mutate from one thing to something inherently very
different and it gives me great pleasure to be able to finally have a
direct relationship with the audience as i see fit and appropriate.
look for some announcements in the near future regarding 2008.
exciting times, indeed.
posted by trent reznor at 10:45 am.


More information on the usual place

Wednesday, October 03, 2007

FASTA, betta, more

My girlfriend's sister asked for help. But all she got was a 16.

The purpose of this script is to get a file(name) as a first argument, a regexp as a second argument and then search trough the file and print out the whole sequence where any of the possible regexp values are found, being that the searched sequence itself must be identified with "<>" symbols and then do a little basic math with the elements we've found.

To try this out, save the following as (for instance) sequences.txt:

>50c's and 50t's
cccccccccccccccccccccccccccccccccccccccccccccccccctttttttttt
tttttttttttttttttttttttttttttttttttttttt
>10G's and 90A's
GGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>A random sequence
ccagtcctgtctaaggactttggttcatgcgttaatttcggttagccagtggcgcccacg
taacaaagtgcgaccgacctgcttccatagcattgaaatgtccttgattggagattttac
gcaggaggactgataagttcgggtctgaattgatgcagcgaacgttcatccaatactcag
acttgcactcagtcg
>A second random sequence
cgcatgacggccctcctcgacggttcattaaccttgcacaccaactgttcctcaaccgat
ctggtgtctttctcacttacatagcagttgctgtaccatttgatgggaacccgagatcac
cgggttatcgcgggagtttattccgaattgttctcggaaatgtggcgtcggcttgaattg
ggaataatacggatcttgacaagcacgatttcatccacaatgcggcacgagtaatcccct
tctggaaggatgcagaaaggacatatacaatgagctagccacgtggcgcataacgcagct
tggttagaaactaaatctatacaggaagatacagaatgggaacagtgtcgctcagtctag
ccagctagatccgcctttagtcgaccttaggggtaaggca

And the below code as scripty.pl:

print "\n\n *girfriends_sister_school_id* \*girfriends_sisters_friend_school_id*\n\n";
print "filename:\n";
$filename = ;
open(TEMPFILE, $filename) or die("Cannot open the file $filename");
print "Insert the regular expression to find:\n";
chomp($regexp=);
while () {

if ( /^>/xms) {
$paragraph = "";
$paragraph_head = $_
}
if ( /^$/xms) {
push @paragraphs, $paragraph;
} else {
$paragraph .= $_;
}
}
push @paragraphs, $paragraph;
foreach (@paragraphs) {
while ( $_ =~ /($regexp)/gi) {
$expressions{$1} += 1;
}
}
foreach $key (keys %expressions) {
print "\n\nPattern = $key\n";
foreach (@paragraphs) {
if ($_ =~ /$key/) {
$paragraph_with_patterns = $_;
$total = length$paragraph_with_patterns;
$counterA = 0;
$counterC = 0;
$counterT = 0;
$counterG = 0;
if ($key =~ /a/){
while ( $paragraph_with_patterns =~ /a/gi) {
$counterA += 1;
$sum1 = ($counterA/$total);
}
}
if ($key =~ /c/){
while ( $paragraph_with_patterns =~ /c/gi) {
$counterC += 1;
$sum2 = ($counterC/$total);
}
}
if ($key =~ /t/){
while ( $paragraph_with_patterns =~ /t/gi) {
$counterT += 1;
$sum3 = ($counterT/$total);
}
}
if ($key =~ /g/){
while ( $paragraph_with_patterns =~ /g/gi) {
$counterG += 1;
$sum4 = ($counterG/$total);
}
}
$paragraph_with_patterns =~ s/($key)/\<$1\>/gi;
print "$paragraph_with_patterns\n\n";
%sum = ();
%sum1 = ();
%sum2 = ();
%sum3 = ();
%sum4 = ();
if ($counterA >0){
%sum1 = ("A", $counterA);
}
if ($counterC >0){
%sum2 = ("C", $counterC);
}
if ($counterT >0){
%sum3 = ("T", $counterT);
}
if ($counterG >0){
%sum4 = ("G", $counterG);
}
%sum = (%sum1,%sum2,%sum3,%sum4);
foreach $key_id (sort hashValueDescendingNum (keys(%sum))) {
$div = ($sum{$key_id}/$total);
print "$key_id = $sum{$key_id} \/ $total = $div\n";
}
}
}
}
sub hashValueDescendingNum{
$sum{$b} <=> $sum{$a};
}
exit;

Then run perl scripty.pl . Put sequences.txt as the file and a[c|t]g as the regexp when prompted.

I had alot of fun doing this wich is a good thing since I didn't get paid.

And no, neither bio::perl, nor any other module for that matter, were options.

Finally, a major thank you must go out to sab for the priceless (as in: he didn't get paid either) help.

Tuesday, October 02, 2007

::1

This is my new home. I won it in a City contest.





As another geek has said before, the only hard thing to do when moving to a new 127.0.0.1 (or ::1 in IPv6) is dealing with the gas company. What a bunch of pricks!

Well, anyways you're always ...