Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to extract the number and name of lncRNA from GTF

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to extract the number and name of lncRNA from GTF. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Extract the ID and name of lncRNA from the GTF file

When extracting the expression of lncRNA from TCGA data, you need to know the number of lncRNA and the corresponding name. This information can be extracted from the GTF file.

If you extract it, you can implement it in the following code.

#! / usr/bin/perl-wuse strict;my $biotype_file = shift @ ARGV;my $gtf = shift @ ARGV;my $biotype = shift @ ARGV;my% biotype_list;open my $fh2, $biotype_file or die;while () {chomp; my @ array = split /\ t fh2, $_; if ($array [2] eq $biotype) {$biotype_list {$array [0]} = 1;} close $fh2;open my $out, "> ${biotype} _ info.txt" or die Print $out "Gene_id\ tGene_id_info\ tgene_name\ tbiotype\ n"; open my $fh3, $gtf or die;while () {chomp; next if / ^ # /; my @ array = split /\ t gene, $_; next unless ($array [2] eq "gene"); $array [8] = ~ / gene_id\ s + "(\ swatches?)";. * gene_type\ s + "(\ swatches?)";. * gene_name\ s + "(\ sbanks?)"; / My $geneid = $1; my $genebiotype = $2; my $genename = $3; my $gene_id_norm= (split ("\\.", $geneid)) [0]; if ($biotype_list {$genebiotype}) {print $out "$gene_id_norm\ t$geneid\ t$genename\ t$genebiotype\ n";} close $fh3 This is the end of the article on "how to extract the number and name of lncRNA from GTF". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report