Re: calculate within a loop

2016-09-12 Thread Nathalie Conte
---\n"; foreach my $name ( sort keys %hall) { print "name.$name\n"; foreach my $subject (sort keys %{ $hall{$name} }) { print "suject.$subject\n"; foreach my $values ( sort keys %{ $hall{$name}{$subject}}) { state ($lgrade,$lsubject,$lname,$ltimes);

calculate within a loop

2016-09-09 Thread Nathalie Conte
alculation, in each $name (Peti and Foo), calculate: for Peti: first line : no action second line -(minus) 1st line: print subject 3-1=2, 89-88=1 third line - 2nd line: print subject 4-3=1, 99-89=10 for foo: first line : no action second line -(minus) 1st line: print subject 2-1=2, 107-97=10 Many thanks for any advice Best Nathalie

Re: help with Hash of arrays of arrays

2015-07-02 Thread Nathalie Conte
HI Shlomi, Thanks for your comments about best practise which I have implemented, Any ideas on why my hash of arrays of arrays is misbehaving? Thanks Nat On 1 Jul 2015, at 15:42, Shlomi Fish wrote: > Hi Nat, > > some comments about your code. > > On Wed, 1 Jul 2015 13:00:53 +0100 > nco...@ebi

Re: parsing script help please

2012-05-31 Thread nathalie
You want something like this: #!/software/bin/perl use warnings; use strict; my $file = "example.txt"; open my $in, '<', $file or die "Cannot open '$file' because: $!"; while ( <$in> ) { next if /^#/; chomp; my ( $key, @fields ) = split /\t/; print map "$key\t$_\n", @fields;

Re: parsing script help please

2012-05-31 Thread nathalie
7;, '4483180-4483486' ]; And this is I believe where you wanted to go. Of course you could just print it directly without the need for the temp variables etc but I assume that you want to do something more with the found values then just dump them on your screen.

parsing script help please

2012-05-31 Thread nathalie
4483180-4483486 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4797994-4798062 1 4798535-4798566 1 4818664-4818729 1 4820348-4820395 1 4822391-4822461 1 4827081-4827154 1 4829467-4829568 1 4831036-4831212 1 4835043-4835096 many thanks Nathalie

Re: parsing script misbehaving...

2011-10-21 Thread Nathalie Conte
Rob Dixon wrote: On 21/10/2011 11:31, Nathalie Conte wrote: HI Rob, Hello Nat Please keep your replies to the Perl beginners list, so that other people can both help and learn from the discussion. (It would also help if you could bottom-post your replies (put the response after the text you

don't know where to start??? comparing files

2011-10-12 Thread Nathalie Conte
HI All, I have 2 sets of files I want to compare,and I don't know where to start to get what I want :( I have a reference file ( see ref for example) with a chromosome name, a start and a end position Chr7115249090115859515 Chr82525549629565459 Chr13198276698298299815 Ch

parsing script removing some lines help please

2011-09-30 Thread Nathalie Conte
Hi, I am lost in my script, and would need to basic help please. I have got a file , separated by tabs, and the first column contain a chromosome number, then several other column with different infos. Basically I am trying to created a script that would take a file(see example), parse line b

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
I forgot to say that the extra lines are empty... but I don't understand why they are there :) HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I wa

parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I want to keep only the lines where there is a 1 not the ones with -1, there are 10 in this example

parsing file need help please

2011-06-08 Thread Nathalie Conte
HI, Me again with another parsing script :) this time, I have this file format, see below, I want to assess if the genotyping data ( 2 letters at the beginning) are the same in column 1 or 2, NN should be ignored (as no results provided). I should count as well the number of heterozygous ( when

fastq file modification help

2011-06-06 Thread Nathalie Conte
Hi, I need to remove the first 52 bp sequences reads in a fastq file,sequence is on line 2. fastq file from wikipedia:A FASTQ file normally uses four lines per sequence. Line 1 begins with a '@' character and is followed by a sequence identifier and an /optional/ description. Line 2 is the raw

another parsing script :)

2011-05-13 Thread Nathalie Conte
HI, I have a file with sequences each sequence is 200 pb long and I have 30K lines ATGGATAGATA\n TTCGATTCATT\n GCCTAGACAT\n TTGCATAGACTA\n I want to calculate the AT ratio of each base based on their position (3/4) for the 1st position, 3/4 on the second, (0/4) on the 3rd... I am beginner

help me with a parsing script please

2011-05-12 Thread Nathalie Conte
HI, I have this file format chrstartendstrand x 12241 x24481 1100124-1 1124148-1 Basically I would like to create a new file by grouping the start of the first line (12) with the end of the second line (48) and so on the output shoul