logo Netzschleuder network catalog, repository, and centrifuge

History of hiv_transmission

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 03379f5..ee43fab 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -30,7 +30,7 @@ In all properties, the code -9 means "out of design" and -8 means "not asked", a
 tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
 url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'https://doi.org/10.3886/ICPSR22140.v1')]
-icon_hash = ['57b4bcfc67351c5e0ccd340f', '59fe8f2fee01e9ab21ac7fc1']
+date_added = '2020-08-11'
 upstream_license = None
 upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 files = [("ICPSR_22140-V1.zip:ICPSR_22140/DS0002/22140-0002-Data.tsv", None, None)]
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 13dd278..03379f5 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -46,7 +46,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] Remove the remarks on the distribution of the data from the descriptions of beer_reviews, bluesky_failla, citibike, divvy, facebook100, goodreads, hiv_transmission, hollywood_actors, mind_news, movielens_10m_tags, movielens_32m, movielens_ratings, netflix_prize, opensky_flights, opensky_flights_full, regulondb, statsbomb, yelp_restaurants and yelp_reviews by Tiago de Paula Peixoto 8be09c8
The descriptions said whether the data may be distributed (access
tokens, restrictions, redistribution bans, take-downs); the site shows
restricted entries itself, and the descriptions now only describe the
data.
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 772e54f..13dd278 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -21,7 +21,7 @@ from .. import *
 title = "HIV transmission network (1988-2001)"
 description = r"""A network of sexual, drug-use, needle-sharing and social contacts among people at high risk of HIV and other sexually transmitted infections, from the "Network Metastudy Project" archive assembled by M. Morris and R. Rothenberg, which combines the data of eight network studies conducted in North America between 1988 and 2001 (with some interviews up to 2003): Colorado Springs Project 90, Bushwick (Brooklyn), Atlanta Urban, Flagstaff (rural Arizona), Atlanta Antiviral, Houston, Baltimore SHIELD, and Manitoba. The studies recruited participants with different designs (e.g. contact tracing from infected persons, chain-link referral from targeted seeds, egocentric and saturation sampling), and in each interview the respondent named their contacts in a recent time window (typically 6 months). Some studies were longitudinal, with repeated interviews of the same persons.
 
-Nodes are persons (respondents and the contacts they named), and each directed edge is a record of a tie, pointing from the person who named it to the person named (the "egodyads" file of the archive; the file of ties among alters is not included). The same pair of persons can be connected by several edges, e.g. for different types of tie or different interviews. Since the person identifiers of the source data are only unique within each study, persons are identified here by their study and ID, and the nodes and edges of each study can be selected with the property `STUDYNUM`. The data are distributed by ICPSR under restricted access.
+Nodes are persons (respondents and the contacts they named), and each directed edge is a record of a tie, pointing from the person who named it to the person named (the "egodyads" file of the archive; the file of ties among alters is not included). The same pair of persons can be connected by several edges, e.g. for different types of tie or different interviews. Since the person identifiers of the source data are only unique within each study, persons are identified here by their study and ID, and the nodes and edges of each study can be selected with the property `STUDYNUM`.
 
 In all properties, the code -9 means "out of design" and -8 means "not asked", and missing dates are given as 01-Jan-1900. The properties are taken from the variables of the source data, as described in its codebook:
 
[entries] hiv_transmission: mark as downloaded by hand; packet_delays: skip certificate verification by Tiago de Paula Peixoto 4230f9f
hiv_transmission's data come from ICPSR, which requires a login, so its
health check could only fail. packet_delays' server leaves out an
intermediate certificate of its chain, which browsers fetch themselves but
Python does not, so the download is made without verifying it.
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 65fcc98..772e54f 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -35,6 +35,8 @@ upstream_license = None
 upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 files = [("ICPSR_22140-V1.zip:ICPSR_22140/DS0002/22140-0002-Data.tsv", None, None)]
 restricted = True
+# Downloaded by hand: ICPSR requires a login (see process_entry)
+manual_download = True
 
 def fetch_upstream(force=False):
     return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
[entries] Fix parse bugs and improve descriptions and metadata by Tiago de Paula Peixoto 6bb6851
- parse fixes from the review of the descriptions, e.g. us_patents
  (directed), celegans_2019 (synapse direction), ecoli_transcription and
  yeast_transcription (regulator to target), bitcoin (direction, phantom
  node), ego_social (Google+ features and circles), scotus_majority,
  arxiv_authors and social_location (as in SNAP), caida_as, dnc, dom,
  mist, reuters and bibsonomy (names on the right nodes), uci_zoo
- every description now states explicitly what the nodes and edges
  represent; corrected titles, years, tags, citations and licences
- the "Hypergraph" tag is removed; very large entries are marked
  `huge = True` (see --skip-huge)
- ICON ids of partial duplicates added (hiv_transmission, congress_bills,
  openflights, dutch_school)
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index e4ea0fb..65fcc98 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -30,7 +30,7 @@ In all properties, the code -9 means "out of design" and -8 means "not asked", a
 tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
 url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'https://doi.org/10.3886/ICPSR22140.v1')]
-icon_hash = '57b4bcfc67351c5e0ccd340f'
+icon_hash = ['57b4bcfc67351c5e0ccd340f', '59fe8f2fee01e9ab21ac7fc1']
 upstream_license = None
 upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 files = [("ICPSR_22140-V1.zip:ICPSR_22140/DS0002/22140-0002-Data.tsv", None, None)]
[entries] Fix parse bugs and improve the metadata of existing entries by Tiago de Paula Peixoto c996a0e
From a review of the dataset descriptions against the upstream sources
and papers, and from user reports:

- parse fixes (wrong edge direction or directedness, shifted or
  misnamed properties, merged node identities, duplicated or missing
  edges and nodes, wrong types), e.g. arxiv_citation (the HepTh dates
  were a copy of the HepPh ones; now from the KDD Cup 2003 data),
  eu_procurements, foursquare_global, hiv_transmission, genetic_multiplex,
  gnutella (adds the 05 snapshot), roadnet, macaque_neural, python_dependency
- descriptions rewritten from the upstream sources, documenting every
  property
- corrected titles, citations and DOIs, licences (ustream_license typo,
  the data's own terms), tags and ICON ids
- url lists for entries with several sources or dataset pages
- SocioPatterns entries moved to the site's new data location, with the
  daily networks of sp_infectious and sp_primary_school
- the Michael Fire entries marked as orphans (served from the mirror)
- redundant type forcings removed after the graph-tool coercion fixes
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index c7fb94d..e4ea0fb 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -19,13 +19,19 @@
 from .. import *
 
 title = "HIV transmission network (1988-2001)"
-description = """A set of networks of HIV transmissions between people through sexual, needle-sharing, or social connections, based on combining 8 datasets collected from 1988 to 2001. Metadata includes test results of several diseases, as well as demographic variables such as age, ethnicity, and gender. Networks come in two flavors: egodyads and altdyads. Egodyads are the network among study-participants and their direct partners. Altdyads are the network among people who are connected to the egodyad network. All data contained in a single file, but individual networks can be extracted using the 'studynum' variable (see codebook).[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = r"""A network of sexual, drug-use, needle-sharing and social contacts among people at high risk of HIV and other sexually transmitted infections, from the "Network Metastudy Project" archive assembled by M. Morris and R. Rothenberg, which combines the data of eight network studies conducted in North America between 1988 and 2001 (with some interviews up to 2003): Colorado Springs Project 90, Bushwick (Brooklyn), Atlanta Urban, Flagstaff (rural Arizona), Atlanta Antiviral, Houston, Baltimore SHIELD, and Manitoba. The studies recruited participants with different designs (e.g. contact tracing from infected persons, chain-link referral from targeted seeds, egocentric and saturation sampling), and in each interview the respondent named their contacts in a recent time window (typically 6 months). Some studies were longitudinal, with repeated interviews of the same persons.
+
+Nodes are persons (respondents and the contacts they named), and each directed edge is a record of a tie, pointing from the person who named it to the person named (the "egodyads" file of the archive; the file of ties among alters is not included). The same pair of persons can be connected by several edges, e.g. for different types of tie or different interviews. Since the person identifiers of the source data are only unique within each study, persons are identified here by their study and ID, and the nodes and edges of each study can be selected with the property `STUDYNUM`. The data are distributed by ICPSR under restricted access.
+
+In all properties, the code -9 means "out of design" and -8 means "not asked", and missing dates are given as 01-Jan-1900. The properties are taken from the variables of the source data, as described in its codebook:
+
+- Vertex properties: `name` (person ID within the study), `STUDYNUM` (study, with the codes given below), and the attributes of the person recorded in the dyad records: `testdat` (date of lab test), `SG` (sample generation, i.e. number of steps from a seed of the chain-referral sampling; 0 = seed), `NTYPE` (1 = respondent, 2 = eligible, 3 = alter), `FRSTTYP` (whether the person first appeared as respondent or alter), `IDKNOWN` (identity known), `LOCAL` (resided in the study jurisdiction), `RACE` (1 = American Indian, 2 = Black, 3 = Asian/Pacific Islander, 4 = White, 5 = other), `ETHN` (Hispanic), `SEX`, `ORIENT` and `BEHAV` (self-reported and behavioral sexual orientation), `OCCPRES` and `OCCCENS` (occupational prestige and census code), `OCC` and `OCCLOC` (occupation and its location), `AGE`, `YOB` (year of birth), `MARIT` (marital status), `EDUC` (educational attainment), indicators of being a sex worker (`PRO`), pimp (`PIMP`), client of sex workers (`JOHN`), drug dealer (`DEALER`), drug manufacturer (`DRUGMAN`), thief (`THIEF`), retired (`RETIRED`), housewife (`HWIFE`), on disability (`DISABLE`), unemployed (`UNEMP`) or homeless (`STREETS`), lab test results for gonorrhea, chlamydia, syphilis, HIV and hepatitis B (`GONO`, `GONOEV`, `CHLAM`, `CHLAMEV`, `SYPH`, `SYPHEV`, `HIV`, `HBV`), self-reported history of these infections (`GONOHX`, `CHLAMHX`, `SYPHHX`, `HIVHX`), `LINENUM` (order of elicitation), `FRSTYR` (study year of first appearance), `SOURCES` (number of persons that named this person) and `BACKFIL` (whether demographic information was backfilled from self-reports).
+- Edge properties: `TIETYPE` (mode of connection: 0 = other, 1 = social, 2 = drug, 3 = sexual, 4 = needle), `DYADKEY` and `DYADTYPE` (0 = direct partner, otherwise suspect/associate), `RECENT` (1 = tie within the interview window, 0 = at any time in the past), `FREQ` (frequency of contact: 1 = once or twice, 2 = a few times, 3 = steady), `intdate`, `begdate`, `enddate` and `testdate` (dates of the interview, of the first and most recent contact, and of the respondent's lab test), `YEAR` (year of interview), `STDYYEAR` (years since the base interview), `ITER` (interview number), `WINDOW` (time window used to elicit contacts), `SAMPLE` (sampling scheme: 1 = saturation, 2 = contact tracing, 4 = chain-link tracing, 6 = egocentric, 7 = three-link chain and mixed), `CHAIN` and `NET_TYPE` (sampling chain identifiers), `RELTYPE` (relationship of the contact to the respondent, e.g. "FRIEND"), `STUDYNUM` (study: 1 = Colorado Springs Project 90, 2 = Bushwick, 3 = Atlanta Urban, 4 = Flagstaff, 5 = Atlanta Antiviral, 6 = Houston, 7 = Baltimore SHIELD, 8 = Manitoba), `RID` (ID of the interviewed respondent, which usually but not always coincides with the person who named the contact), and the attributes of that respondent at the time of the interview, with the same names and codes as the vertex properties above."""
 tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
 url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'https://doi.org/10.3886/ICPSR22140.v1')]
 icon_hash = '57b4bcfc67351c5e0ccd340f'
-ustream_license = None
+upstream_license = None
 upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 files = [("ICPSR_22140-V1.zip:ICPSR_22140/DS0002/22140-0002-Data.tsv", None, None)]
 restricted = True
@@ -48,15 +54,25 @@ def parse(alts=None):
         with ExitStack() as stack:
             fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
 
-            props = fs[0].readline().strip().split("\t")
-            del props[1:3]
-            ptypes = ["string"] * len(props)
-            g = load_graph_from_csv(fs[0], ecols=(1, 2),
-                                    hashed=True,
-                                    hash_type="string",
-                                    eprop_names=props,
-                                    eprop_types=ptypes,
-                                    csv_options=dict(delimiter="\t"))
+            reader = csv.reader(fs[0], delimiter="\t")
+            props = next(reader)
+            i1 = props.index("ID1")
+            i2 = props.index("ID2")
+            istudy = props.index("STUDYNUM")
+            ecols = [i for i in range(len(props)) if i not in (i1, i2)]
+
+            # ID1 named ID2; person IDs are only unique within a study
+            g = Graph(directed=True)
+            eprops = [g.new_ep("string") for i in ecols]
+            for i, ep in zip(ecols, eprops):
+                g.ep[props[i]] = ep
+            def get_lines():
+                for row in reader:
+                    s = row[istudy]
+                    yield ([f"{s}:{row[i1]}", f"{s}:{row[i2]}"] +
+                           [row[i] for i in ecols])
+            key = g.add_edge_list(get_lines(), hashed=True,
+                                  hash_type="string", eprops=eprops)
 
             for name in list(g.ep.keys()):
                 if name.endswith("1") or name.endswith("2"):
@@ -74,4 +90,6 @@ def parse(alts=None):
                             vp[e.target()] = ep[e]
                     del g.ep[name]
 
+            g.vp.name = g.new_vp("string", vals=[k.split(":")[1] for k in key])
+            g.vp.STUDYNUM = g.new_vp("string", vals=[k.split(":")[0] for k in key])
         yield alt, g
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 72f9a5b..c7fb94d 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright information by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index aa398f4..72f9a5b 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright information by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 918d94c..aa398f4 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright info by Tiago de Paula Peixoto db2efcc
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 89f9112..918d94c 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update citations to use DOIs by Tiago de Paula Peixoto e878874
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index f803a1f..89f9112 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -23,7 +23,7 @@ description = """A set of networks of HIV transmissions between people through s
 [^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
 url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
-citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'http://doi.org/10.3886/ICPSR22140.v1')]
+citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'https://doi.org/10.3886/ICPSR22140.v1')]
 icon_hash = '57b4bcfc67351c5e0ccd340f'
 ustream_license = None
 upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
Change license from GPLv3 to AGPLv3 by Tiago de Paula Peixoto d754be5
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 58d2c9c..f803a1f 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -3,18 +3,18 @@
 #
 # Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from .. import *
 
Add explicit attribution to descriptions obtained from ICON by Tiago de Paula Peixoto 1645314
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
index 81f2ab9..58d2c9c 100644
--- a/entries/hiv_transmission/__init__.py
+++ b/entries/hiv_transmission/__init__.py
@@ -19,7 +19,8 @@
 from .. import *
 
 title = "HIV transmission network (1988-2001)"
-description = "A set of networks of HIV transmissions between people through sexual, needle-sharing, or social connections, based on combining 8 datasets collected from 1988 to 2001. Metadata includes test results of several diseases, as well as demographic variables such as age, ethnicity, and gender. Networks come in two flavors: egodyads and altdyads. Egodyads are the network among study-participants and their direct partners. Altdyads are the network among people who are connected to the egodyad network. All data contained in a single file, but individual networks can be extracted using the 'studynum' variable (see codebook)."
+description = """A set of networks of HIV transmissions between people through sexual, needle-sharing, or social connections, based on combining 8 datasets collected from 1988 to 2001. Metadata includes test results of several diseases, as well as demographic variables such as age, ethnicity, and gender. Networks come in two flavors: egodyads and altdyads. Egodyads are the network among study-participants and their direct partners. Altdyads are the network among people who are connected to the egodyad network. All data contained in a single file, but individual networks can be extracted using the 'studynum' variable (see codebook).[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
 url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
 citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'http://doi.org/10.3886/ICPSR22140.v1')]
Initial commit by Tiago de Paula Peixoto cc85872
diff --git a/entries/hiv_transmission/__init__.py b/entries/hiv_transmission/__init__.py
new file mode 100644
index 0000000..81f2ab9
--- /dev/null
+++ b/entries/hiv_transmission/__init__.py
@@ -0,0 +1,76 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "HIV transmission network (1988-2001)"
+description = "A set of networks of HIV transmissions between people through sexual, needle-sharing, or social connections, based on combining 8 datasets collected from 1988 to 2001. Metadata includes test results of several diseases, as well as demographic variables such as age, ethnicity, and gender. Networks come in two flavors: egodyads and altdyads. Egodyads are the network among study-participants and their direct partners. Altdyads are the network among people who are connected to the egodyad network. All data contained in a single file, but individual networks can be extracted using the 'studynum' variable (see codebook)."
+tags = ['Social', 'Public Health', 'Unweighted', 'Metadata']
+url = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
+citation = [('M. Morris and R. Rothenberg. "HIV Transmission Network. Metastudy Project: An Archive of Data From Eight Network Studies, 1988–2001.” Inter-university Consortium for Political and Social Research (2011).', 'http://doi.org/10.3886/ICPSR22140.v1')]
+icon_hash = '57b4bcfc67351c5e0ccd340f'
+ustream_license = None
+upstream_prefix = 'http://www.icpsr.umich.edu/icpsrweb/NAHDAP/studies/22140'
+files = [("ICPSR_22140-V1.zip:ICPSR_22140/DS0002/22140-0002-Data.tsv", None, None)]
+restricted = True
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if isinstance(fnames, str):
+            fnames = [fnames]
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+            props = fs[0].readline().strip().split("\t")
+            del props[1:3]
+            ptypes = ["string"] * len(props)
+            g = load_graph_from_csv(fs[0], ecols=(1, 2),
+                                    hashed=True,
+                                    hash_type="string",
+                                    eprop_names=props,
+                                    eprop_types=ptypes,
+                                    csv_options=dict(delimiter="\t"))
+
+            for name in list(g.ep.keys()):
+                if name.endswith("1") or name.endswith("2"):
+                    n = name[:-1]
+                    ep = g.ep[name]
+                    vp = g.vp.get(n, None)
+                    if vp is None:
+                        vp = g.new_vp("string")
+                        g.vp[n] = vp
+                    if name.endswith("1"):
+                        for e in g.edges():
+                            vp[e.source()] = ep[e]
+                    else:
+                        for e in g.edges():
+                            vp[e.target()] = ep[e]
+                    del g.ep[name]
+
+        yield alt, g