Sponsored Content
Full Discussion: Venn Data Maker
Homework and Emergencies Emergency UNIX and Linux Support Venn Data Maker Post 302979840 by jacobs.smith on Friday 19th of August 2016 01:20:54 PM
Old 08-19-2016
Quote:
Originally Posted by RudiC
Do we need to guess what an "intersection" is? Any attempt from your side?

My apologies Rudic.

If the value is "1" in any set, that means a presence of value and it should be counted.

If the value is "0" in any set, that means an absent and it should not be counted.

Ex:

Code:
Name, set1, set2, set3
g1,0,0,1
g2,0,0,1
g3,1,1,0

Gene1 and Gene2 are present only in set3. So set3_unique=2.

Gene3 is present in both set1 and set2. So set12_common=1

Please ask me more questions and I will be glad to reply.

Also - the number of lines in the intersectionlist.txt should be equal to = (2^(number of sets))-1

Thanks.
 

2 More Discussions You Might Find Interesting

1. Programming

maker

how can i remake a program to crash a harddrive using unix:rolleyes: (2 Replies)
Discussion started by: flomper
2 Replies

2. Shell Programming and Scripting

Venn diagram results using awk

Hi, I have the following files 1.txt a 10 b 11 c 12 d 13 e 14 f 15 g 16 h 17 i 18 j 19 k 20 2.txt a 21 b 22 (15 Replies)
Discussion started by: jacobs.smith
15 Replies
DateTime::Span(3pm)					User Contributed Perl Documentation				       DateTime::Span(3pm)

NAME
DateTime::Span - Datetime spans SYNOPSIS
use DateTime; use DateTime::Span; $date1 = DateTime->new( year => 2002, month => 3, day => 11 ); $date2 = DateTime->new( year => 2003, month => 4, day => 12 ); $set2 = DateTime::Span->from_datetimes( start => $date1, end => $date2 ); # set2 = 2002-03-11 until 2003-04-12 $set = $set1->union( $set2 ); # like "OR", "insert", "both" $set = $set1->complement( $set2 ); # like "delete", "remove" $set = $set1->intersection( $set2 ); # like "AND", "while" $set = $set1->complement; # like "NOT", "negate", "invert" if ( $set1->intersects( $set2 ) ) { ... # like "touches", "interferes" if ( $set1->contains( $set2 ) ) { ... # like "is-fully-inside" # data extraction $date = $set1->start; # first date of the span $date = $set1->end; # last date of the span DESCRIPTION
"DateTime::Span" is a module for handling datetime spans, otherwise known as ranges or periods ("from X to Y, inclusive of all datetimes in between"). This is different from a "DateTime::Set", which is made of individual datetime points as opposed to a range. There is also a module "DateTime::SpanSet" to handle sets of spans. METHODS
o from_datetimes Creates a new span based on a starting and ending datetime. A 'closed' span includes its end-dates: $span = DateTime::Span->from_datetimes( start => $dt1, end => $dt2 ); An 'open' span does not include its end-dates: $span = DateTime::Span->from_datetimes( after => $dt1, before => $dt2 ); A 'semi-open' span includes one of its end-dates: $span = DateTime::Span->from_datetimes( start => $dt1, before => $dt2 ); $span = DateTime::Span->from_datetimes( after => $dt1, end => $dt2 ); A span might have just a beginning date, or just an ending date. These spans end, or start, in an imaginary 'forever' date: $span = DateTime::Span->from_datetimes( start => $dt1 ); $span = DateTime::Span->from_datetimes( end => $dt2 ); $span = DateTime::Span->from_datetimes( after => $dt1 ); $span = DateTime::Span->from_datetimes( before => $dt2 ); You cannot give both a "start" and "after" argument, nor can you give both an "end" and "before" argument. Either of these conditions will cause the "from_datetimes()" method to die. To summarize, a datetime passed as either "start" or "end" is included in the span. A datetime passed as either "after" or "before" is excluded from the span. o from_datetime_and_duration Creates a new span. $span = DateTime::Span->from_datetime_and_duration( start => $dt1, duration => $dt_dur1 ); $span = DateTime::Span->from_datetime_and_duration( after => $dt1, hours => 12 ); The new "end of the set" is open by default. o clone This object method returns a replica of the given object. o set_time_zone( $tz ) This method accepts either a time zone object or a string that can be passed as the "name" parameter to "DateTime::TimeZone->new()". If the new time zone's offset is different from the old time zone, then the local time is adjusted accordingly. If the old time zone was a floating time zone, then no adjustments to the local time are made, except to account for leap seconds. If the new time zone is floating, then the UTC time is adjusted in order to leave the local time untouched. o duration The total size of the set, as a "DateTime::Duration" object, or as a scalar containing infinity. Also available as "size()". o start o end First or last dates in the span. It is possible that the return value from these methods may be a "DateTime::Infinite::Future" or a "DateTime::Infinite::Past"xs object. If the set ends "before" a date $dt, it returns $dt. Note that in this case $dt is not a set element - but it is a set boundary. o start_is_closed o end_is_closed Returns true if the first or last dates belong to the span ( begin <= x <= end ). o start_is_open o end_is_open Returns true if the first or last dates are excluded from the span ( begin < x < end ). o union o intersection o complement Set operations may be performed not only with "DateTime::Span" objects, but also with "DateTime::Set" and "DateTime::SpanSet" objects. These set operations always return a "DateTime::SpanSet" object. $set = $span->union( $set2 ); # like "OR", "insert", "both" $set = $span->complement( $set2 ); # like "delete", "remove" $set = $span->intersection( $set2 ); # like "AND", "while" $set = $span->complement; # like "NOT", "negate", "invert" o intersects o contains These set functions return a boolean value. if ( $span->intersects( $set2 ) ) { ... # like "touches", "interferes" if ( $span->contains( $dt ) ) { ... # like "is-fully-inside" These methods can accept a "DateTime", "DateTime::Set", "DateTime::Span", or "DateTime::SpanSet" object as an argument. SUPPORT
Support is offered through the "datetime@perl.org" mailing list. Please report bugs using rt.cpan.org AUTHOR
Flavio Soibelmann Glock <fglock@gmail.com> The API was developed together with Dave Rolsky and the DateTime Community. COPYRIGHT
Copyright (c) 2003-2006 Flavio Soibelmann Glock. All rights reserved. This program is free software; you can distribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Set::Infinite For details on the Perl DateTime Suite project please see <http://datetime.perl.org>. perl v5.12.4 2011-08-22 DateTime::Span(3pm)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy