Dear Christian,
would you please explain the logic of the following line?
my $baf = ($AllelePeaks0 - 250)/(750-250);
thanks
Howdy y'all,
I'm having a hard time intrepreting the cychp format.
Here's the affy documentation but it doesn't tell me what the symbols in the actual file mean. I have no idea http://media.affymetrix.com/support/developer/powertools/changelog/gcos-agcc/cychp.html
So has anyone worked with this .cychp file before? Is there an in house or 3rd party program that allows me to retrieve the data?
Tusen takk
You need to first convert the cychp file into a readable text format with Affymetrix Powertools and then you can parse it.
Convert to text
apt-1.15.2-x86_64-intel-linux/bin/apt-chp-to-txt --chp-files samples.chpfile --out-dir .
The file 'samples.chpfile' needs to be created first with a text editor and should contain the filenames of your .cychp files that you want to convert.
Parse text file to obtain log R ratios and allele peaks
use warnings FATAL => qw( all );
use strict;
use Getopt::Long;
my ($lrr_file, $baf_file, $sample_name);
GetOptions
(
"lrr-file=s" => \$lrr_file,
"baf-file=s" => \$baf_file,
"sample-name=s" => \$sample_name,
);
die "ERROR: --lrr-file not specified" if (!$lrr_file);
die "ERROR: --baf-file not specified" if (!$baf_file);
die "ERROR: --sample-name not specified" if (!$sample_name);
open(LRR, ">$lrr_file") or die "ERROR: Could not write to file $lrr_file\n";
open(BAF, ">$baf_file") or die "ERROR: Could not write to file $baf_file\n";
print LRR "\tchrs\tpos\tLRR_$sample_name\n";
print BAF "\tchrs\tpos\tBAF_$sample_name\n";
while(<>)
{
last if (/^ProbeSetName\tChromosome\tPosition\tLog2Ratio\tWeightedLog2Ratio\tSmoothSignal/);
}
while(<>)
{
last if (/^#/);
my ($ProbeSetName, $Chromosome, $Position, $Log2Ratio, $tWeightedLog2Ratio, $tSmoothSignal) = split(/\t/);
print LRR "$ProbeSetName\t$Chromosome\t$Position\t$Log2Ratio\n";
}
while(<>)
{
last if (/^ProbeSetName\tChromosome\tPosition\tAllelePeaks0\tAllelePeaks1/);
}
while(<>)
{
last if (/^#/);
my ($ProbeSetName, $Chromosome, $Position, $AllelePeaks0, $AllelePeaks1) = split(/\t/);
my $baf = ($AllelePeaks0 - 250)/(750-250);
$baf = 0 if ($baf < 0);
$baf = 1 if ($baf > 1);
print BAF "$ProbeSetName\t$Chromosome\t$Position\t$baf\n";
}
while(<>) {}; # read pipe to the end to avoid SIGPIPE error status 141
close(LRR);
close(BAF);
Log in to answer this question.
this is not really a data exchange format, rather it is a special binary format, it feels unlikely that other people develop software for it.