Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Captainrave

    Script not working correctly :(

    Much appreciated. I will take a look at that.
  2. Captainrave

    Script not working correctly :(

    Will do :)
  3. Captainrave

    Script not working correctly :(

    Script is below - I reverted back to the old format to make some of the changes. It now also outputs the sequences that it finds into a new file (makes it easier to verify them). Unfortunately, I realised there is another problem with the approach I am taking, but at least the script now works -...
  4. Captainrave

    Script not working correctly :(

    All sorted now. Many thanks for your help :) The final error, was that I completely forgot that Perl is 0-indexed, so I was directing it to the wrong column :(
  5. Captainrave

    Script not working correctly :(

    After further thought, I think the problem is 100% with the Fasta file. The script must be counting characters that it shouldn't be - it should only be counting A, C, G or T and ignoring the header. Is there a way to tell it to skip out anything other than A, C, G or T? For example, I believe...
  6. Captainrave

    Script not working correctly :(

    Yes, that is exactly what I want it to do. I just need it to locate the 4th element of the csv value i.e. Repeat Start in the FASTA file, then to output X and Y at the end of the row. I still don't think it is locating the correct place in the string that we are referencing though. If it is...
  7. Captainrave

    Script not working correctly :(

    You make a couple of very good points. Firstly, I must remember to delete that header before I run the script. Second, if my script is counting the characters present, to get to position X in my example, would it find anything in the line break that it could also be counting? I have just...
  8. Captainrave

    Script not working correctly :(

    Interesting, that actually changed the result of the output! Still not quite right though and I can still not see why. Have been working all day on this. This is some rough pseudocode - - Goto File 1 (csv file) and for each line, store the number in column 4 (lets call it X) - Goto File 2...
  9. Captainrave

    Script not working correctly :(

    Hi all, I wrote a script that basically finds a "start" coordinate in File 1, goes to the correct position in file 2 (then either jumps forward 1 or 2 positions), then counts the number of positions (in groups of 3) until either TAG, TAA or TGA are located; the number of positions are recorded...
  10. Captainrave

    Grabbing a number and counting letters...

    Hi all, it has been a long while since I have needed to do any Perl coding! How easy is the following to do? For once I have a good idea what I need to do (makes a change), but this time I have forgotten HOW to do it. File 1 (csv file), for each line: store the number in column 4 (lets call it...
  11. Captainrave

    Help comparing two files

    Have tested and it works like a charm! Sorry, I should have noticed that! Many thanks to everyone who helped :)
  12. Captainrave

    Help comparing two files

    I have modified it slightly to better suit my needs. I definitely understand how it works. However, I get the following error: "Global symbol "$key" requires explicit package name at ComplementDeletionV2.pl l ine 10." What does that mean? use warnings; use strict; my %keys; open (FILE1...
  13. Captainrave

    Help comparing two files

    Thanks for your help :)
  14. Captainrave

    Help comparing two files

    Thanks Kevin. I am now having trouble with the minor technicalities of this script i.e. getting the line and calculation into the new file (I am calling it File 3). Not sure I have got the splits right either! use warnings; use strict; my %HASH1; open(OUTPUT,"+>File 3.csv"); chomp $FILE3...
  15. Captainrave

    Help comparing two files

    In the first file the number is always unique. In the second file the number can be repeated on multiple lines. Yes, the number in the first file needs to get compared to all the lines in the second file. Compare as in equal values. When I say "do the calculation". I mean perform the...
  16. Captainrave

    Help comparing two files

    I don't think it makes much difference, but the calculation is just 100 minus the number in column J!
  17. Captainrave

    Help comparing two files

    OK, I have changed my approach slightly (the mistake is bigger than I thought!). Firstly, both files are in CSV format. The first now has three columns that look like: 3254 5041 - 8277 9047 - 9052 10056 + 10053 10427 - 10431 11270 + 11271 12011 + The second...
  18. Captainrave

    Help comparing two files

    Thanks for the reply. I have been trying to implement that, but so far with little success. I will keep trying.
  19. Captainrave

    Help comparing two files

    Hi all, I ran into a huge problem with my work today and think a Perl script will fix it and hopefully save me weeks of tedious work (and needless to say get the boss off my back!). Basically I am stuck comparing two files. The first has two columns that look like: 3254 5041 8277 9047 9052...
  20. Captainrave

    Counting the number of repeat "units"

    Modified your idea and it works Prex1!!! while(<REPEATFILE>){ chomp; my($firstcol)=split/,/; $firstcol=~m/^([acgt]+?)\1+$/i; print OUTFILE $_,',',length($1)?length($firstcol)/length($1):0,"\n"; } As ever, many thanks!!!!!!

Part and Inventory Search

Back
Top