Perl script on rna G quadruplex

0

Hello researchers ,

i am stucked in perl script on rna g quadruplex to find/count the total number of specific unique sequences in which G should be 3 runs and loops should be 7 only , i used grep function with regular expression and array in which i gave input as a fasta file and in the last i counted regular exression in which the code is running means the perl script, but answers are not correct means answer is coming same for all different types of regular expression, can any one please help me out with the same ?

can any one share perl script for unique / specific sequences total counts of G 3 and L7 ONLY ..

i used the most common regular expression : ([gG]{3,}w{1,7}){3,}[gG]{3,}

i tried simple code syntax=grep_function(regular_expression,@array)

full script i used :

#!/usr/bin/perl-w

#To count total transcripts containing G-Quadruplexes
#Input filename

print "Please enter file name: ";

$name =<>;

chomp $name;

open OUT ,">.$name.OUTPUT";
open(FASTA,$name) or die;

@data =<FASTA>;
$data = join('',@data); #Convert to string

@data2 = split('n',$data); #Explode on newline into array elements
@unique = grep(!$seen{$_}++,@data2); #Extract unique elements from @data2

$unique = join('',@unique); #Convert to string
@uniqueid = split('',$unique); #Explode string back into individual array elements.

#Intialize count

$countid=0;

foreach $id(@uniqueid){

if($id eq "N"){
++$countid;
}
}

#Print

print "nnNumber of transcripts is : $countid";
print OUT "Number of unique transcripts is : $countid";

#Exit
exit;

THANK U


perl


G-quadruplex


rna

• 361 views



Source link