User: Kenosis

gravatar for Kenosis
Kenosis1.2k
Reputation:
1,200
Status:
Trusted
Location:
Last seen:
5 years, 7 months ago
Joined:
7 years ago
Email:
p***********@gmail.com

about me

Posts by Kenosis

<prev • 130 results • page 1 of 13 • next >
0
votes
4
answers
8.3k
views
4
answers
Comment: C: Perl script running slow with big files
... My apologies for not explaining my claim... In the first while loop, only the first five fields are used; the remaining are discarded, including the last field which contains the record separator that chomp would remove.  In the second while loop, the record separator is retained and used later whe ...
written 5.6 years ago by Kenosis1.2k
0
votes
1
answer
1.7k
views
1
answers
Comment: C: Regex motif question - 2 or more residues out of XXXX are D/E ?
... Try Perl's transliteration operator: use strict; use warnings; while ( my $string = <DATA> ) {     chomp $string;     my $count = $string =~ tr/deDE//;     my $twoPlus = $count > 1 ? '*' : '';     print "$string: $count$twoPlus\n" } __DATA__ XXXXXXXXXX DDXXXXXXDX XXEXXXDXEX XXDXXXXXXX DE ...
written 5.6 years ago by Kenosis1.2k
3
votes
4
answers
8.3k
views
4
answers
Answer: A: Perl script running slow with big files
... Consider the following refactoring: use strict; use warnings; use autodie; my ( @array, %hash ); open my $FILE, "<", "dbSNP_in.vcf"; while (<$FILE>) {     $hash{"@array[0, 1, 3, 4]"} = $array[2] if @array = split /\t/, $_, 6; } close $FILE; open my $OUT,   ">", "trial_output.vcf"; ...
written 5.6 years ago by Kenosis1.2k
1
vote
7
answers
2.6k
views
7
answers
Answer: A: How to extract Gene symbol from protein fasta file header?
... Here are a couple of Perl options: use strict; use warnings; while (<>) {     print "$1\n" if /(Gene_Symbol.+)/; } Command-line usage: perl script.pl inFile.fasta >IPIGenes.txt As a one-liner: perl -lne 'print $1 if /(Gene_Symbol.+)/' inFile.fasta >IPIGenes.txt Output from both on ...
written 5.6 years ago by Kenosis1.2k
0
votes
3
answers
16k
views
3
answers
Comment: C: replace fasta headers with another name in a text file
... The update only insures that blank lines are skipped -- just in case any exist. You have: perl rename.pl name.txt seq.fasta > new seq.fasta Did you mean `new_seq.fasta`? You *do* need the underscore in the name. ...
written 5.7 years ago by Kenosis1.2k • updated 6 weeks ago by RamRS25k
0
votes
3
answers
16k
views
3
answers
Comment: C: replace fasta headers with another name in a text file
... You're most welcome! I accidently omitted naming the perl script in the directions. Have fixed the original posting. You should do the following (the last parameter being optional): perl script.pl textFile fastaFile [>outFile] My apologies for this oversight. ...
written 5.7 years ago by Kenosis1.2k • updated 6 weeks ago by RamRS25k
0
votes
3
answers
16k
views
3
answers
Comment: C: replace fasta headers with another name in a text file
... I got your desired output on your datasets you've just included. However, I'm not too sure about your text file's formatting. Thus, I've refactored the code block after the first `while`. Perhaps that will be helpful. I got the following from both versions: ANT_1 VTSLGLCMKPSKWDRTYKFAQGVPSL ...
written 5.7 years ago by Kenosis1.2k • updated 6 weeks ago by RamRS25k
1
vote
3
answers
16k
views
3
answers
Answer: A: replace fasta headers with another name in a text file
... Here's a Perl option: use strict; use warnings; my @arr; while (<>) { chomp; push @arr, $_ if length; last if eof; } while (<>) { print /^>/ ? shift(@arr) . "\n" : $_; } Usage: perl script.pl textFile fa ...
written 5.7 years ago by Kenosis1.2k • updated 6 weeks ago by RamRS25k
1
vote
2
answers
1.2k
views
2
answers
Answer: A: perl script: extracting mir-target information based on a list
... Here's another option that uses Perl to handle the file i/o (no need to explicitly open and close files), and a capture to grab the first part of your mir-target infor file lines: use strict; use warnings; @ARGV == 2 or die 'perl sta.pl LIST INPUT'; my %h; while ( ...
written 5.7 years ago by Kenosis1.2k • updated 7 weeks ago by RamRS25k
0
votes
1
answer
2.4k
views
1
answers
Comment: C: Is it possible using a regex in perl to include both accession number and the ma
... 1. Your script doesn't compile. 2. Always: `use strict; use warnings;` 3. Use lexical file handles. 4. No need to `s/^\>//` since `>` is `chomp`ed as the unique FASTA record separator. 5. No need to `s/\s//g` when `split`ting on `' '`. 6. No need to `join` the sequence lines for the pattern m ...
written 5.8 years ago by Kenosis1.2k • updated 8 weeks ago by RamRS25k

Latest awards to Kenosis

Teacher 5.9 years ago, created an answer with at least 3 up-votes. For A: How To Extract Multiple Fasta Sequences From A File With Perl?
Centurion 5.9 years ago, created 100 posts.
Supporter 5.9 years ago, voted at least 25 times.
Teacher 5.9 years ago, created an answer with at least 3 up-votes. For A: How To Reformat A Fasta File To A Custom Tabular Format
Teacher 5.9 years ago, created an answer with at least 3 up-votes. For A: Any Script To Parse Fasta Headers?
Teacher 5.9 years ago, created an answer with at least 3 up-votes. For A: Why Perl Or Sed Command Not Working
Guru 5.9 years ago, received more than 100 upvotes.
Teacher 5.9 years ago, created an answer with at least 3 up-votes. For A: How To Shift Alignment Of Short Sequences
Commentator 6.0 years ago, created a comment with at least 3 up-votes. For C: Identify Overlapping And Non Overlapping Regions For Paired-End Data
Teacher 6.4 years ago, created an answer with at least 3 up-votes. For A: Perl :Fuzzy Matching Problem
Appreciated 6.4 years ago, created a post with more than 5 votes. For A: Perl :Fuzzy Matching Problem
Good Answer 6.4 years ago, created an answer that was upvoted at least 5 times. For A: Perl :Fuzzy Matching Problem
Appreciated 6.9 years ago, created a post with more than 5 votes. For A: Looking For A Script To Reformat A Biological Data File
Teacher 6.9 years ago, created an answer with at least 3 up-votes. For A: How To Reformat A Fasta File To A Custom Tabular Format
Commentator 6.9 years ago, created a comment with at least 3 up-votes. For C: Interleaving Records From More Than One Fasta File
Appreciated 7.1 years ago, created a post with more than 5 votes. For A: Any Script To Parse Fasta Headers?
Teacher 7.1 years ago, created an answer with at least 3 up-votes. For A: Any Script To Parse Fasta Headers?

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1882 users visited in the last hour