Articles

Metasploit Framework Windows Tutorial
Remote Desktop Connection
Windows Processes That May Be Dangerous
How-To use NetCat a Tutorial
Common Linux Commands
Common Ports
Netcat Commands
HTTP Response Codes
War-Google Hack Terms
Wardriving
Avoiding Social Engineering and Phishing Attacks
Intrusion Detection on Linux
Linux Intrusion Detection
Penetration Testing Guide
Penetration Testing Tools
Social Engineering Fundamentals, Part I: Hacker Tactics
Social engineering (computer security)
The Psychology of Social Engineering

The Archives

General GSO
GovernmentSecurity.org News & Suggestions
In The News
Open Topic
General Security Information
Trash Can
Exploit & Vulnerability Mailing List Archives
Trial Member Forum
Product and Program Reviews GSO Tutorials
System Security
Windows Systems
Beginners Section
Linux & Unix Systems
File Downloads
Exploit Research & Discussion Trojan & Virus Errata
Networking Security / Firewall / IDS / VPN / Routers
System Hardening
E-Mail Security
Wifi Security
Trial Member Uploads
Upload discovered Trojans & Mal ware
GSO Programming Section
C , C++ , VC++
Visual Basic.NET
Perl /CGI
Java/Javascript
PHP/XML/ASP/HTML
Assembly + Other
The Cork Board
Network Security Consultant Directory
Network Security Jobs
The Archives
Encryption Information
General Network Security
Internet Anonymity
HTTP Protocol Security
Linux Security
MS IIS Information
Exploit Articles
Programming / Tool Design
GSO Software Projects
Public Downloads
Microsoft Security Questions and Papers

Full Version: Math::combinatorics
Scr47h3
Hey all,
I'm working on a project for Biology that is basically a PERL script. I'm using PERL to calculate genotypic ratios of dihybrid gene things (I don't remember the term - we covered this last semester). But, don't worry about the terminology. I need help with using the Math::Combinatorics module to make the gametes of the two parents. This basically involves taking the parent genetic sequence, and then making all of the combinations of 2 using each individual gene from the parent. Here is kind of what it would look like, in psuedo-code, using only one parent as an example:

@parent1 = qw ( A a B b ); # Each element of the array is a gene.

|
V

################################
################################
## Combine the elements of the genetic array ## This is what I need help with.
## and put it into @gametes ##
################################
################################

|
V

# So basically, @gametes now = qw ( AA Aa AB Ab aB ab Bb bb ), I think, and then I
# have to remove the gametes that consist of only one letter.
# So now I have @gametes = qw ( AB Ab aB ab ).


So basically, I have to combine the contents of an array (@parent1) and store that in a new array (@gametes). I have done some research, and have concluded that using the Math::Combinatorics's exported function 'combine()' would be the easiest way to do this, so I tried doing just that. I came up with this error:

Undefined subroutine &main::combine called at C:\PERL\genetics\COMBIN~1.PL line 5.

Here is the source code I am using (this is just test code):

#!perl -w
use math::combinatorics;

@letters = qw ( A a B b );
@combined = combine(2, @letters);

print "@combined";

Does anyone know either how to make this work, or how to do what I need in a different way?



Thanks, and sorry for the long post,
Evan
Scr47h3
Well, never mind, everybody! I got it! I did a lot of research, and found that I needed this one line of code:

sub (combine);

Or, I could use:

use Math::Combinatorics (combine);

Either one of these will work. So, after a bit more work, I discovered that the combine function returns an array of arrays. So after implementing the proper code to iterate through the array of arrays, I got the gametes! Then it was just a simple matter of removing the impossible gametes (Bb, for examle) by using a simple regular expression. So now, this works, and the rest of the project will be done soon.

Evan
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.