User Profile

Collapse

Profile Sidebar

Collapse
sessmurda
sessmurda
Last Activity: Jul 30 '08, 08:26 PM
Joined: Jul 1 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sessmurda
    replied to Find out the number of lines in an array
    in Perl
    Actually I am making the array in my code and need two outputs, one is where I am outputting the actual array to a file, and I also needed the number count to be output to yet another file. I have been writing a large code to do a few different things, but the section of the code that applies to this question is below. When I try the $#ArrayName it outputs the a lot of 1s that add up to the total number of characters, not the number of lines....
    See more | Go to post

    Leave a comment:


  • sessmurda
    started a topic Find out the number of lines in an array
    in Perl

    Find out the number of lines in an array

    I was wondering if there was a way to find out how many lines were stored in an array, and then to be able to have that number stored in an array itself. I've been googling and searching the forum but cant find anything that works for me.
    See more | Go to post

  • Ah, now I feel like an idiot, but thanks for all the suggestions guys, and especially thanks for your patience kevinadc
    See more | Go to post

    Leave a comment:


  • My bad, here is the data:

    Code:
     662376     [S] |GCGG | |     |
     662375     [S] |CGCC | |     |
     662374     [S] |GCGG | |     |
     662373     [H] |CATC | |     |
     662371     [Y] |TCCC | |     |
     662369     [M] |CACCC| |     |
     662367     [Y] |TCTTT| |     |
     662365     [S] |GCGGG| |     |
     662364     [R] |AGAAA| |     |
     662360     [M] |CACCC| |     |
     662359
    ...
    See more | Go to post

    Leave a comment:


  • Sorry for the late response, had a conference away in LA, but after playing with the script and using warnings I have figured out that even though when I print out only the $position, do not use STDIN for orf_beg, or redefine $position not to include decimals, the script tells me this..

    Use of uninitialized value in string gt at gamma.pl line 25, <IN> line 1.
    Use of uninitialized value in string gt at gamma.pl line 25,...
    See more | Go to post

    Leave a comment:


  • I am currently working on the foreach and while/if suggestions you guys provided, thanks! To answer some questions: the position is a number, it doesnt show when I copy and pasted the text, but there is a lot of white space between the last number of the position and the sequence character to allow for the fact that on occasion there will need to be decimals due to the format of the file. I checked all of the substring column numbers before posting,...
    See more | Go to post

    Leave a comment:


  • Thats not the variable that perl isnt recognizing, the $position is the problem, I defined orf beg before opening the file handle so that during the loop it wouldnt ask me to input the start of the ORF before every iteration.
    See more | Go to post

    Leave a comment:


  • How to get a while loop to recognize an extracted number

    I am writing a fairly simple script that is supposed to print out lines from a txt file and group them based on where I want them. The general format of the files I am using the script on is as follows:

    662376 [S] |GCGG | | |
    662375 [S] |CGCC | | |
    662374 [S] |GCGG | | |
    662373 [H] |CATC | | |
    662371 [Y] |TCCC | | |
    662369 [M] |CACCC| | |
    ...
    See more | Go to post

  • sessmurda
    replied to Usage of shift command
    in Perl
    The errors were

    Scalar found where operator expected at alpha.pl line 4, near "$|"
    (Missing semicolon on previous line?)
    Bareword found where operator expected at alpha.pl line 9, near "$file_q = "/home"
    (Might be a runaway multi-line // string starting on line 5)
    (Missing operator before home?)
    String found where operator expected at alpha.pl line 11, near...
    See more | Go to post

    Leave a comment:


  • sessmurda
    replied to Usage of shift command
    in Perl
    Thanks, I've been fiddling with your suggestions, only problem is the final set of code you said to insert after the shebang line just forces the script to give me a lot of errors instead of doing anything, basically I just want it to not repeat the first 10 characters of sequence over again, and dont know exactly how to set up the shift function, any help with that would be great
    See more | Go to post

    Leave a comment:


  • sessmurda
    started a topic Usage of shift command
    in Perl

    Usage of shift command

    So I'm fairly new at perl and was looking for help with the usage of the shift command, which I think will help me solve a problem I've been having. Here is my script as is:
    Code:
    #!/usr/bin/perl
    #print "Where is the output file located?";
    #chomp($file_q = <STDIN>);
    $file_q = "/home/asession/pracperl/x.txt";
    
    open(FILE, $file_q) ||die "nope\n";
    while(<FILE>){
    ...
    See more | Go to post
    Last edited by numberwhun; Jul 3 '08, 05:07 PM. Reason: Please use code tags

  • sessmurda
    replied to 2 questions for perl text manipulation
    in Perl
    Thanks! I've done a bit more manipulation to get it to do exactly what I want, your help is greatly appreciated!
    See more | Go to post

    Leave a comment:


  • sessmurda
    replied to 2 questions for perl text manipulation
    in Perl
    Basically the format of my data is like this, but contains closer to like 10,000 lines.

    cere 662376 G
    para 662376 C
    baya 662376 x
    cere 662375 C
    para 662375 G
    baya 662375 x
    cere 662374 G
    para 662374 C
    baya 662374 x
    cere 662373 C
    para 662373 A
    baya 662373 x
    cere 662372 A
    para 662372 A
    ...
    See more | Go to post

    Leave a comment:


  • sessmurda
    started a topic 2 questions for perl text manipulation
    in Perl

    2 questions for perl text manipulation

    I've just started programming in perl and have written a few successful scripts but had a quick question on how to do 2 things.

    First here is a script that I wrote recently that works for what it is supposed to do, but is not quite what I want.

    Code:
    #!/usr/bin/perl
    
    $file_q = "x.txt";
    
    open(FILE, $file_q)||die "nope\n";
    while(<FILE>){
    
    @line = split(/\s+/,
    ...
    See more | Go to post
    Last edited by eWish; Jul 1 '08, 01:52 AM. Reason: Please use code tags
No activity results to display
Show More
Working...