<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://chk.ipmb.sinica.edu.tw/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/feed.php">
        <title>Kuo Lab Wiki - tutorials:perl</title>
        <description></description>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/</link>
        <image rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/lib/exe/fetch.php/wiki/logo.png" />
       <dc:date>2026-04-06T06:20:11+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/cmd_blast_.1.pl?rev=1339691371&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/combine_files.pl?rev=1339691810&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/correct_fasta_orientation.1.pl?rev=1339691539&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_ecori_site.pl?rev=1339691892&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_first_name.pl?rev=1339691777&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_1.pl?rev=1339691868&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_2.pl?rev=1339691904&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/execute.3.pl?rev=1339691392&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_empty_file.2.pl?rev=1491979527&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_homopolymer.3.pl?rev=1339691524&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_hsp.4.pl?rev=1339691487&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_sim.6.pl?rev=1339691409&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_first_name.pl?rev=1339691744&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/read_and_write.pl?rev=1339561270&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/rename_file_by_regex.3.pl?rev=1491989254&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_lucy.2.pl?rev=1339691562&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_seq_by_regex.1.pl?rev=1339691650&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_fasta.pl?rev=1339691825&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_seq_fasta.1.pl?rev=1339691507&amp;do=diff"/>
                <rdf:li rdf:resource="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/write_lines_to_files.pl?rev=1339691794&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/lib/exe/fetch.php/wiki/logo.png">
        <title>Kuo Lab Wiki</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/</link>
        <url>https://chk.ipmb.sinica.edu.tw/wiki/lib/exe/fetch.php/wiki/logo.png</url>
    </image>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/cmd_blast_.1.pl?rev=1339691371&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:29:31+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>cmd_blast_.1.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/cmd_blast_.1.pl?rev=1339691371&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'cmd_blast+.1.pl';

# Chih-Horng Kuo 
# generate commands for running NCBI blast+
# v1 2010/07/13

use strict;
use warnings;

use Getopt::Long;
use File::Basename;

my $exe;
my $in_dir;
my $out_dir;
my $sh_dir;
my $in_file_ext;
my $out_file_ext;
my $sh_prefix;
my $opt;
my $n_job;
my $debug;

GetOptions(
    &quot;exe=s&quot;          =&gt; \$exe,
    &quot;in_dir=s&quot;       =&gt; \$in_dir,
    &quot;out_dir=s&quot;      =&gt; \$out_dir,
    &quot;sh_dir=s&quot;       =&gt; \$sh_dir,
    &quot;in_file_ext=s&quot;  =&gt;…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/combine_files.pl?rev=1339691810&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:36:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>combine_files.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/combine_files.pl?rev=1339691810&amp;do=diff</link>
        <description># combine_files.pl
# The opposite of write_lines_to_files; 
# obtain an input directory and an output file 
# from the command line, read the files in the 
# input directory and write their content to 
# one single output file.
# Note that we want to exclude hidden files 
# in the input directory.

my $in_dir = shift;
my $out_file = shift;

open OUT, &quot;&gt;$out_file&quot;;

opendir( DIR, $in_dir ) or die &quot;can't open $in_dir: $!\n&quot;;
foreach $in_file ( sort readdir(DIR) ) { 
 	next if ( $in_file =~ /^\./ )…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/correct_fasta_orientation.1.pl?rev=1339691539&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:32:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>correct_fasta_orientation.1.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/correct_fasta_orientation.1.pl?rev=1339691539&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'correct_fasta_orientation.1.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# correct sequence orientation in a .fasta file
# v1 2010/12/31

use strict;
use warnings;

use Getopt::Long;
use File::Basename;

my $in_file;
my $in_fasta;
my $out_file;
my $verbose;
my $debug;

GetOptions(
    &quot;in_file=s&quot;  =&gt; \$in_file,
    &quot;in_fasta=s&quot; =&gt; \$in_fasta,
    &quot;out_file=s&quot; =&gt; \$out_file,
    &quot;verbose=i&quot;  =&gt; \$verbose,
    &quot;debug=i&quot;    =&gt; \$debug,
);

my $out_dir = dirname(…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_ecori_site.pl?rev=1339691892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:38:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>count_ecori_site.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_ecori_site.pl?rev=1339691892&amp;do=diff</link>
        <description># count_EcoRI_site.pl
# Read a fasta file and count the number of 
# EcoRI restriction sites in each sequence. 
my $in_file = shift;

my $seq_hash; # key = seq_name, value = seq;
{
	# redefine the record separator
	local $/ = &quot;&gt;&quot;;
	open IN, &quot;&lt;$in_file&quot;;
	my $in_line = &lt;IN&gt;; # toss the first record
	while ( $in_line = &lt;IN&gt; ) {
		chomp $in_line; # remove the &quot;&gt;&quot; character in the end 
		my ( $seq_name, $seq ) = split( /\n/, $in_line, 2 );
		$seq =~ tr/ \t\n\r//d;    # Remove whitespace
		$seq_hash{…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_first_name.pl?rev=1339691777&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:36:17+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>count_first_name.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/count_first_name.pl?rev=1339691777&amp;do=diff</link>
        <description># count_first_name.pl
# Read an input file that contains several names 
# (assuming one name in each line, the first name 
# and the last name are separate by a space). 
# Count how the number of times each first name appeared 
# in the input. Print the result to STDOUT, 
# sort the names alphabetically.

my $in_file = shift;

my %count_hash; # key = first_name, value = count

open IN, &quot;&lt;$in_file&quot;;
while ( my $line = &lt;IN&gt; ) {
	chomp $line;
	my ( $first_name, $last_name ) = split /\s/, $line;
	$c…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_1.pl?rev=1339691868&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:37:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>display_codon_1.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_1.pl?rev=1339691868&amp;do=diff</link>
        <description># display_codon_1.pl
# Read a fasta file that contain protein-coding sequences. 
# Re-format the sequences to show codons (10 codons per line) 
# in the output file.
# this version uses substr function to get the codons
my $in_file = shift;
my $out_file = shift;

my $seq_hash; # key = seq_name, value = seq;
{
	# redefine the record separator
	local $/ = &quot;&gt;&quot;;
	open IN, &quot;&lt;$in_file&quot;;
	my $in_line = &lt;IN&gt;; # toss the first record
	while ( $in_line = &lt;IN&gt; ) {
		chomp $in_line; # remove the &quot;&gt;&quot; charact…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_2.pl?rev=1339691904&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:38:24+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>display_codon_2.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/display_codon_2.pl?rev=1339691904&amp;do=diff</link>
        <description># display_codon_2.pl
# Read a fasta file that contain protein-coding sequences. 
# Re-format the sequences to show codons (10 codons per line) 
# in the output file.
# this version uses regular expression to obtain the codons
my $in_file = shift;
my $out_file = shift;

my $seq_hash; # key = seq_name, value = seq;
{
	# redefine the record separator
	local $/ = &quot;&gt;&quot;;
	open IN, &quot;&lt;$in_file&quot;;
	my $in_line = &lt;IN&gt;; # toss the first record
	while ( $in_line = &lt;IN&gt; ) {
		chomp $in_line; # remove the &quot;&gt;&quot; c…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/execute.3.pl?rev=1339691392&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:29:52+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>execute.3.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/execute.3.pl?rev=1339691392&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'execute.3.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# execute all .sh in the in_dir
# v3 2010/02/04
#   style change
# v2 2009/06/18
# v1 2006/05/03

use strict;
use warnings;

use Getopt::Long;

my $in_dir;
my $exe_dir;
my $in_file_ext;
my $batch_file_ext;
my $log_file_ext;
my $prefix;    # prefix of batch files
my $n_job;     # split into n batch files
my $debug;

GetOptions(
    &quot;in_dir=s&quot;         =&gt; \$in_dir,
    &quot;exe_dir=s&quot;        =&gt; \$exe_dir,
    &quot;i…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_empty_file.2.pl?rev=1491979527&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-04-12T06:45:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>find_empty_file.2.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_empty_file.2.pl?rev=1491979527&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'find_empty_file.2.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# find empty files in the &quot;--in_dir&quot;
# use the &quot;--regex&quot; option to set search regex (e.g., --regex=&quot;*.txt&quot;)
# set &quot;--opt_rm=1&quot; to remove those files
# v2 2010/07/12
#   style change
# v1 2007/05/25

use strict;
use warnings;

use Getopt::Long;

my $in_dir;
my $regex;
my $opt_rm;
my $verbose;
my $debug;

GetOptions(
    &quot;in_dir=s&quot;  =&gt; \$in_dir,
    &quot;regex=s&quot;   =&gt; \$regex,
    &quot;opt_rm=i&quot;  =&gt; \$opt_r…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_homopolymer.3.pl?rev=1339691524&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:32:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>find_homopolymer.3.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/find_homopolymer.3.pl?rev=1339691524&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'find_homopolymer.3.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# read fasta file, find homopolymeric regions in the seqs
# v3 2010/07/13
#   bug fix: process the last base
#   change output format
# v2 2009/09/29
#   report the position of homopolyers in GFF3 format
# v1 2009/09/22

use strict;
use warnings;

use Getopt::Long;
use File::Basename;

my $in_file;
my $out_file;
my $min;
my $verbose;
my $debug;

GetOptions(
    &quot;in_file=s&quot;      =&gt; \$in_file,
    …</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_hsp.4.pl?rev=1339691487&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:31:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>parse_blast_hsp.4.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_hsp.4.pl?rev=1339691487&amp;do=diff</link>
        <description>#!/usr/bin/perl

my $script_name = 'parse_blast_hsp.4.pl';

# parse blast results
# output = parsed format for sequence similarity, 1 hsp per line
# v4 2010/09/20
#   bug fix: hsp length (should be 'total', not 'query')
#   output format change
# v3 2010/08/05
#   add strand info
# v2 2010/07/15
#   style change
#   change output format
# v1 2007/04/16

use strict;
use warnings;

use Getopt::Long;
use Bio::SearchIO;

my $in_file;
my $out_file;
my $format;
my $print_seq;
my $debug;

GetOptions(
 …</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_sim.6.pl?rev=1339691409&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:30:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>parse_blast_sim.6.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_blast_sim.6.pl?rev=1339691409&amp;do=diff</link>
        <description>#!/usr/bin/perl

my $script_name = 'parse_blast_sim.6.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# parse blast results
# input = blast
# output = parsed format for sequence similarity, 1 hit per line
# v6 2010/11/05
#   add format opt, use xml as the default
#   the query_id is now obtained from query_description, not query_name
# v5 2010/07/15
#   style change
# v4 2008/09/10
#   change output format
# v3 2007/02/26
#   bug fix: correct calculation of frac_HSP
# v2 2007/02/09
#   set max(frac_H…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_first_name.pl?rev=1339691744&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:35:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>parse_first_name.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/parse_first_name.pl?rev=1339691744&amp;do=diff</link>
        <description># parse_first_name.pl
# Read from an input file 
# (containing a list of full names) 
# and write the first names to an output file. 
# Assume the two filenames are provided in the command line. 

my $in_file = shift;
my $out_file = shift;

open IN, &quot;&lt;$in_file&quot;;
open OUT, &quot;&gt;$out_file&quot;;
while ( my $line = &lt;IN&gt; ) {
	chomp $line;
	my ( $first_name, $last_name ) = split /\s/, $line;
	print OUT &quot;$first_name\n&quot;;
}
close OUT;
close IN;</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/read_and_write.pl?rev=1339561270&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-13T04:21:10+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>read_and_write.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/read_and_write.pl?rev=1339561270&amp;do=diff</link>
        <description># read_and_write.pl
# read from an input file 
# and write the content to an output file. 
# Assume the two filenames are provided in the command line. 

my $in_file = shift;
my $out_file = shift;

open IN, &quot;&lt;$in_file&quot;;
open OUT, &quot;&gt;$out_file&quot;;
while ( my $line = &lt;IN&gt; ) {
	print OUT &quot;$line&quot;;
}
close OUT;
close IN;</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/rename_file_by_regex.3.pl?rev=1491989254&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-04-12T09:27:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>rename_file_by_regex.3.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/rename_file_by_regex.3.pl?rev=1491989254&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'rename_file_by_regex.3.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# rename files by regex
# v3 2013/09/14
#   add prefix, suffix option
# v2 2010/12/31
#   add in_file_ext, out_file_ext option
# v1 2009/06/23

use strict;
use warnings;

use Getopt::Long;

my $in_dir;
my $out_dir;
my $in_file_ext;
my $out_file_ext;
my $regex;
my $prefix;
my $suffix;
my $mode;
my $verbose;
my $debug;

GetOptions(
    &quot;in_dir=s&quot;       =&gt; \$in_dir,
    &quot;out_dir=s&quot;      =&gt; \$out…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_lucy.2.pl?rev=1339691562&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:32:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>trim_lucy.2.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_lucy.2.pl?rev=1339691562&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'trim_lucy.2.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# trim lucy output
# v2 2011/01/12
#   add min_start opt
# v1 2010/12/31

use strict;
use warnings;

use Getopt::Long;

my $in_fasta_dir;
my $in_qual_dir;
my $out_fasta_dir;
my $out_qual_dir;
my $in_fasta_file_ext;
my $out_fasta_file_ext;
my $in_qual_file_ext;
my $out_qual_file_ext;
my $min_start;
my $verbose;
my $debug;

GetOptions(
    &quot;in_fasta_dir=s&quot;       =&gt; \$in_fasta_dir,
    &quot;in_qual_dir=s&quot;     …</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_seq_by_regex.1.pl?rev=1339691650&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:34:10+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>trim_seq_by_regex.1.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/trim_seq_by_regex.1.pl?rev=1339691650&amp;do=diff</link>
        <description>Usage: 


perl ~/plscript/trim_seq_by_regex.1.pl \
  --in_file=INPUT_FILE \
  --out_dir=OUTPUT_DIR \
  --regex=&quot;AAACT[CT]AAA[GT]GAATTGACGG(\w+)$&quot; \
  --verbose=1



#!/usr/bin/perl -w

my $script_name = 'trim_seq_by_regex.1.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# trim seqs in a fasta file by provided regex 
# v1 2011/01/13

use strict;
use warnings;

use Getopt::Long;
use File::Basename;


my $in_file;
my $out_dir;
my $regex;
my $verbose;
my $debug;

GetOptions(
    &quot;in_file=s&quot; =&gt; \$in_file…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_fasta.pl?rev=1339691825&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:37:05+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>unwrap_fasta.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_fasta.pl?rev=1339691825&amp;do=diff</link>
        <description># unwrap_fasta.pl
# Read a fasta file, unwrap the sequences 
# (i.e., remove all extra line breaks), 
# and save the result to an output file.
my $in_file = shift;
my $out_file = shift;

my %seq_hash; # key = seq_name, value = seq;
{
	# redefine the record separator
	local $/ = &quot;&gt;&quot;;
	open IN, &quot;&lt;$in_file&quot;;
	my $in_line = &lt;IN&gt;; # toss the first record
	while ( $in_line = &lt;IN&gt; ) {
		chomp $in_line; # remove the &quot;&gt;&quot; character in the end 
		my ( $seq_name, $seq ) = split( /\n/, $in_line, 2 );
		$seq …</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_seq_fasta.1.pl?rev=1339691507&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:31:47+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>unwrap_seq_fasta.1.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/unwrap_seq_fasta.1.pl?rev=1339691507&amp;do=diff</link>
        <description>#!/usr/bin/perl -w

my $script_name = 'unwrap_seq_fasta.1.pl';

# Chih-Horng Kuo &lt;chkuo@lifedev.org&gt;
# remove extra line-breaks (in the sequences) in fasta files
# v1 2010/03/04

use strict;
use warnings;

use Getopt::Long;
use File::Basename;

my $in_dir;
my $in_file_ext;
my $out_dir;
my $out_file_ext;
my $verbose;
my $debug;

GetOptions(
    &quot;in_dir=s&quot;            =&gt; \$in_dir,
    &quot;in_file_ext=s&quot;       =&gt; \$in_file_ext,
    &quot;out_dir=s&quot;           =&gt; \$out_dir,
    &quot;out_file_ext=s&quot;      =&gt; \$out_…</description>
    </item>
    <item rdf:about="https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/write_lines_to_files.pl?rev=1339691794&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2012-06-14T16:36:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>write_lines_to_files.pl</title>
        <link>https://chk.ipmb.sinica.edu.tw/wiki/doku.php/tutorials/perl/write_lines_to_files.pl?rev=1339691794&amp;do=diff</link>
        <description># write_lines_to_files.pl
# Obtain an input file and 
# an output directory from the command line. 
# Produce one output file for each line in 
# the input file, use the line number 
# (i.e., 1, 2, 3, etc) as the filenames.

my $in_file = shift;
my $out_dir = shift;

system &quot;mkdir -p $out_dir&quot; unless -e $out_dir;

my $count_line = 0;
open IN, &quot;&lt;$in_file&quot;;
while ( my $line = &lt;IN&gt; ) {
	$count_line++;
	my $out_file = $out_dir . $count_line;
	open OUT, &quot;&gt;$out_file&quot;;
	print OUT &quot;$line&quot;;
	close OUT;
}…</description>
    </item>
</rdf:RDF>
