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 -...
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 :(
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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!!!!!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.