Bioperl: Checking DNA alphabeth

James Gilbert jgrg@sanger.ac.uk
Thu, 18 May 2000 15:41:04 +0100 (BST)



Gert,

I don't think there is an actual function, but
this is very simply implemented:

	# $seq_obj is a Bio::Seq (or Bio::PrimarySeq)
	my $str = $seq_obj->seq();
	# $str is now the actual sequence string
	die "Sequence contains non [ACGT] characters"
	    if $str =~ /[^ACGT]/;

    James

On Thu, 18 May 2000, gert thijs wrote:

> I am writing a script to process some DNA
> sequences which are in fasta format.  Now I
> would like to check if these sequences contain
> other symbols then ACGT, like N or degenerate
> symbols.  Is there a function in bioperl that
> does this or has someone any idea which
> regular expression to use?
> 
> Thanks,
> Gert Thijs
> 
> 
> -- 
> ==========================================================
> + Gert Thijs              gert.thijs@esat.kuleuven.ac.be +
> +                                                        +
> + Dept. Elektrotechniek ESAT-SISTA                       +
> + Kardinaal Mercierlaan, 94                              +
> + B-3001 HEVERLEE  Belgium                               +
> + Tel :  +32-16-32 18 84 ---- Fax : +32-16-32 19 70      +
> ==========================================================
> =========== Bioperl Project Mailing List Message Footer =======
> Project URL: http://bio.perl.org/
> For info about how to (un)subscribe, where messages are archived, etc:
> http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
> ====================================================================
> 

James G.R. Gilbert
The Sanger Centre
Wellcome Trust Genome Campus
Hinxton
Cambridge                        Tel: 01223 494906
CB10 1SA                         Fax: 01223 494919


=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================