This post is the fourth in a series that illustrates how to plug code written in another language (like C, C++, or Java) into Stata. This technique is known as writing a plugin or as writing a dynamic-link library (DLL) for Stata.
- Plugspy 2 3 1 – Put Your Mac Under Observation
- Plugspy 2 3 1 – Put Your Mac Under Observations
- Plugspy 2 3 1 – Put Your Mac Under Observation Game
- Plugspy 2 3 1 – Put Your Mac Under Observation Video
- Plugspy 2 3 1 – Put Your Mac Under Observation Deck
Explore the world of Mac. Check out MacBook Pro, MacBook Air, iMac, Mac mini, and more. Visit the Apple site to learn, buy, and get support. IAlertU is the first of its kind of alarm system for your Apple MacBook computer. Basically iAlertU is a car alarm for your Apple Mac. IAlertU uses the built in accelerometer and other sensors to trigger an alarm and the iSight camera to capture an image of the thief. IAlertU can be configured to email details of the alarm event to a specific email address.
In this post, I write a plugin in Java that implements the calculations performed by mymean_work() in mymean11.ado, discussed in Programming an estimation command in Stata: Preparing to write a plugin, and I assume that you are familiar with that material.
This post is analogous to Programming an estimation command in Stata: Writing a C plugin and to Programming an estimation command in Stata: Writing a C++ plugin. The differences are due to the plugin code being in Java instead of C or C++. I do not assume that you are familiar with the material in those posts, and much of that material is repeated here.
This is the 32nd post in the series Programming an estimation command in Stata. See Programming an estimation command in Stata: A map to posted entries for a map to all the posts in this series.
Writing a hello-world Java plugin
Before I do any computations, I illustrate how to write and to compile a Java plugin that communicates with Stata. Code block 1 contains the code for myhellojava.ado that calls a Java plugin that makes Stata display “Hello from Java”.
In line 6, javacall executes the helloJavaWork method of the class HelloFromJava, which is in the JAR file hellojavawork.jar.
HelloFromJava.java in code block 2 contains the code for the HelloFromJava class.
Plugspy 2 3 1 – Put Your Mac Under Observation
Line 2 imports the Stata function interface (SFI) from sfi-api.jar, which I copied to the current directory from the Stata/utilities/jar directory distributed with Stata. You should copy the version installed with your Stata to the directory your Java compiler requires.
Line 3 defines the public class HelloFromJava, specified on line 6 of myhellojava.ado.
Line 4 defines the helloJavaWork() method, which is the entry point for the plugin. The signature of the entry method must be of this form. The method is public static. The method returns an int. The method accepts a String array.
Stata treats the returned int as a return code; zero means all went well and not zero identifies an error condition. Stata will exit with the error specified in the returned int if the returned int is not zero. The String array contains the arguments passed to the plugin by javacall.
Line 5 uses the SFI method SFIToolkit.displayln() to display the String “Hello from Java” with an additional line return.
Line 6 returns 0 to Stata, so Stata will not exit with an error code.
I now discuss how to create the JAR file hellojavawork.jar from HelloFromJava.java. I use the Java command-line tools to facilitate this discussion. See Working with Java plugins (Part 1) for details about using the Eclipse integrated development environment (IDE).
In the directory that contains myhellojava.ado and HelloFromJava.java, I also have the sfi-api.jar that I copied from the Stata/utilities/jar directory. On my OS X Mac that has the command-line developer tools installed, I use javac to create HelloFromJava.class from HelloFromJava.java and sfi-api.jar by typing
javac –release 8 -classpath sfi-api.jar HelloFromJava.java
At the time of this writing, Stata works with Java 8, even though Java 9 is having its initial release. I had to specify –release 8, because the command-line tools on my machine work with Java 9 by default. You can omit this option if javac defaults to Java 8 on your machine.
To create the JAR file hellojavawork.jar from HelloFromJava.class, I typed
jar cf hellojavawork.jar HelloFromJava.class
These commands for javac and jar work on all platforms, and you can distribute the jar file made on one platform to other platforms. This cross-platform compatibility is a major advantage of Java.
To ensure that the Stata command discard drops all the Java classes currently loaded into Stata, I also delete the .class compiled by javac before I run the ado-command that uses a Java class. On my OS X Mac, I type
rm HelloFromJava.class
Having created hellojavawork.jar and deleted HelloFromJava.class, I can execute myhellojava.ado in Stata.
Example 1: myhellocjava
If I change HelloFromJava.java, recompile, remake the JAR file, delete the .class file, and type discard in Stata before running myhellojava, Stata will find the new version of the Java class. discard works because Stata’s Java plugin interface uses a custom class loader instead of the Java-system class loader to load a plugin’s JAR file. A problem occurs when you leave your .class files in Stata’s current working directory, because the Java-system class loader will find and load the .class files before Stata’s custom class loader can act. This problem prevents Stata’s discard command from unloading the classes, which means that you must restart Stata to unload old class definitions and to load new versions. To prevent this problem, delete the .class files before calling your Java plugin. (Alternatively, you could work with your Java code outside of Stata’s current working directory, but I prefer deleting the .class files, because they are superfluous once I have the JAR files.)
For simplicity, I have sfi-api.jar, HelloFromjava.java, myhellojava.ado, and hellojavawork.jar in the same directory. For large projects, I would put the .ado and .jar files in directories on Stata’s ADOPATH and use my IDE to manage where I put sfi-api.jar and the Java source files. For the examples in this post, I put sfi-api.jar, all my .ado files, all my Java source files, and the created .jar files into a single directory.
Getting access to the Stata data in your plugin
helloJavaWork() makes Stata display something created inside the plugin. The next step is giving the plugin access to the data in Stata. To illustrate this process, I discuss mylistjava.ado, which uses a plugin to list out observations of the specified variables.
Let’s look at the ado-code first.
In line 6, syntax creates three local macros. It puts the variables specified by the user into the local macro varlist. It puts any if condition specified by the user into the local macro if. It puts any in range specified by the user into the local macro in. I specified max=3 to syntax to limit the number of variables to 3. This limitation is silly, and I would not need it for an example Stata/Mata program, but it simplifies the example Java plugin.
In line 7, marksample creates a sample-inclusion variable, and it puts the name of the sample-inclusion variable in the local macro touse. The sample-inclusion variable is zero for each excluded observation, and it is one for each included observation. marksample uses the variables in the local macro varlist, the if condition in the local macro if, and the range in the local macro in to create the sample-inclusion variable. (All three local macros were created by syntax.) An observation is excluded if any of the variables in the local macro varlist contain a missing value, if it was excluded by the condition in the local macro if, or if it was excluded by the range in the local macro in. The sample-inclusion variable is one for observations that were not excluded.
In line 9, I further simplified the Java plugin by displaying the names of the variables whose values are listed out by the method plugin.
In line 10, javacall calls the plugin. The entry point is the method myListJW() in the class MyListJava, which is defined in the JAR file mylistjw.jar. Because `varlist’ is specified, SFI methods will be able to access the variables contained in the local macro varlist. Because if `touse’ is specified, the SFI method Data.isParsedIfTrue() will return zero if the sample-inclusion variable in `touse’ is zero, and it will return one if the sample-inclusion variable is one. Because `in’ is specified, the SFI methods Data.getObsParsedIn1() and Data.getObsParsedIn2() respectively return the first and the last observations in any user-specified in range.
Specifying `in’ is not necessary to identify the sample specified by the user, because if `touse’ already specifies this sample-inclusion information. However, specifying `in’ can dramatically reduce the range of observations in the loop over the data, thereby speeding up the code.
The code for MyListJava is in code block 4. In a directory that contains MyListJava.java and sfi-api.jar, I created mylistjw.jar on my Mac by typing the following three lines.
javac –release 8 -classpath sfi-api.jar MyListJava.java
jar cf mylistjw.jar MyListJava.class
rm MyListJava.class
If you are reading this post, you can read standard Java. I explain how MyListJava.java illustrates the structure of Java plugins for Stata, and I discuss the SFI methods used in the code. Complete details about the SFI are available at https://www.stata.com/java/api15/, which builds on the [P] java manual entry and the [P] java call manual entry.
myListJW.java returns zero to Stata if all went well, and it returns a nonzero error code if something went wrong. Because none of the methods called can fail, the only error condition addressed is encountering missing values, which is handled in lines 30–34. In the case of an error, line 32 uses SFIToolkit.errorln() to ensure that the error message is displayed by Stata and that it is displayed in red. SFIToolkit.display() is the standard display method used elsewhere in the code.
Java plugins read from or write to Stata objects using methods defined in the SFI. myListJW() does not return any results, so it has a simple structure.
- It uses SFI methods to read from the specified sample of the data in Stata.
- It uses standard Java and SFI methods to make Stata display observations on variables for the specified sample, and it keeps a counter of how many observations are in the specified sample.
- It uses standard Java and SFI methods to display which was the first observation in the sample, which was the last observation in the sample, and how many observations were in the specified sample.
Now, I discuss specific parts of MyListJava.java.
Lines 10, 12, and 14 use methods of SFI Data class. Data.getParsedVarCount() puts the number of variables specified in the varlist into nVariables. Data.getObsParsedIn1() puts the first observation specified by an in range into firstObs. Data.getObsParsedIn2() puts the last observation specified by an in range into lastObs. If an in range was not specified to javacall, firstObs will contain 1, and lastObs will contain the number of observations in the dataset.
firstObs, lastObs, and all Java variables that hold Stata observation numbers are of type long, because Stata datasets can contain more observations than would fit into a Java variable of type int.
Lines 20–22 ensure that we skip over observations that were excluded by the if restriction specified to javacall in line 10 of mylistjava.ado. To illustrate some details, consider example 2.
Example 2: mylistjava
In line 20, Data.isParsedIfTrue(obs) returns one when the if restriction specified to javacall is one for observation obs, and it is zero otherwise. In line 10 of mylistjava.ado, we see that the if restriction passed to javacall is if `touse'. As discussed above, the sample-inclusion variable in the local macro touse is zero for excluded observations, and it is one for the included observations.
The in range on line 10 of mylistjava.ado was included so that the loop over the observations in line 19 of MyListJava.java would only go from the beginning to the end of any specified in range. In example 2, instead of looping over all 74 observations in the auto dataset, the loop on line 19 of MyListJava.java only goes from 2 to 10.
In example 2, the sample-inclusion variable is 1 for 6 observations, and it is 0 for the other 68 observations. The in 2/10 range excludes observation 1 and the observations from 11–74. Of the first 10 observations, 2 are excluded because rep78 is missing. One observation is excluded because trunk is 21.
For comparison, all 9 observations between 2 and 10 are listed in example 3.
Example 3: list
Returning to MyListJava, we see that lines 28–29 illustrate how to put the value of a Stata numeric variable into a Java variable. Note that Data.getNum() returns a double for all Stata numeric variable types. In example 2, mpg, trunk, and rep78 are all of type int in Stata.
Lines 30–34 cause myListJW() to exit with error 416 if any observation in one of the variables contains a missing value. These lines are redundant, because the sample-inclusion variable in touse specified to javacall excluded observations containing missing values. I included these lines to illustrate how I would safely exclude missing values from inside the plugin and to reiterate that Java code must carefully deal with missing values. Stata missing values are valid double precision numbers in Java. You will get wrong results if you include Stata missing values in calculations.
Estimating the mean in a Java plugin
I now discuss the ado-command mymeanjava, which uses the myWork() method in the MyCalcs class to implement the calculations performed by mymean_work() in mymean11.ado, discussed in Programming an estimation command in Stata: Preparing to write a plugin.
The code for mymeanjava is in mymeanjava.ado, which is in code block 5.
The general structure of this program is similar to mymean10.ado and mymean11, discussed in Programming an estimation command in Stata: Preparing to write a plugin.
From a bird's-eye view, mymeanjava.ado
- parses the user input;
- creates a sample-inclusion variable;
- creates temporary names for objects that will hold the results;
- calls a work program to do the calculations;
- stores the results returned by the work program in e(); and
- displays the results.
The main difference between mymeanjava.ado and mymean11.ado is that the work program is a Java plugin instead of a Mata function.
Lines 6 and 7 are identical to those in mylistjava.ado. For a description of how these lines create the local macro varlist, the sample-inclusion variable contained in the local macro touse, and the local macro in that contains any user-specified in range, see the discussion of mylistjava.ado in Getting access to the Stata data in your plugin.
Line 8 puts temporary names into the local macros b, V, and N. We can use these names for results computed by the Java plugin and know that we will not overwrite any results that a user has stored in global Stata memory. (Recall that Stata matrices and scalars are global objects in Stata; see Using temporary names for global objects in Programming an estimation command in Stata: A first ado-command for a discussion of this topic.) In addition, Stata will drop the objects in the temporary names created by tempname when mymeanjava terminates.
Line 10 in mymeanjava is similar to its counterpart of line 10 in mylistjava.ado. In this case, myWork() is the entry method defined in the class MyCalcs, which is in the JAR file mycalcs.jar. The details of varlist, if `touse', and `in' were discussed above. What is new is that we use args(`b' `V' `N') to pass the temporary names to myWork().
The myWork(),
Plugspy 2 3 1 – Put Your Mac Under Observations
- does the calculations;
- puts the estimated means into a new Stata matrix whose name is in the local macro b;
- puts the estimated variance–covariance of the estimator (VCE) into a new Stata matrix whose name is in the local macro V; and
- puts the number of observations in the sample into the Stata scalar whose name is in the local macro N.
Lines 13–15 put the variable names on the column stripe of the vector of estimated means and on the row and column stripes of the VCE matrix. Lines 16–18 store the results in e(). Line 19 displays the results.
Before discussing the details of myWork(), let's create the plugin and run an example.
In a directory that contains MyCalcs.java, MyCalcsW.java, MyMatrix.java, MyLong.java, and sfi-api.jar, I created mycalcs.jar on my Mac by typing
javac --release 8 -classpath MyCalcs.java MyCalcsW.java MyMatrix.java MyLong.java sfi-api.jar
jar cf mycalcs.jar MyCalcs.class MyCalcsW.class MyMatrix.class MyLong.class
rm MyCalcs.class MyCalcsW.class MyMatrix.class MyLong.class
Having created mycalcs.jar, I ran example 3.
Example 4: mymeanjava
I now discuss some aspects of the Java code, beginning with the class MyCalcs.java in code block 6.
MyCalcs.java only contains the entry method myWork(). In summary, myWork() performs the following tasks.
- It puts the names passed in as arguments into instances of Java String objects that can be passed to SFI methods.
- It puts the number of specified Stata variables into a Java variable used to loop over the variables.
- It puts the range of sample observations into Java variables used to
loop over the observations. - It creates the bmat and vmat instances of the MyMatrix class, which will hold the sample averages and the VCE.
- It creates the nObs instance of the MyLong class, which will hold the number of sample observations.
- It uses the methods MyCalcsW.myAve() and MyCalcsW.myV() to
compute the results that are stored in bmat, vmat, and nObs. - It uses the method CopyCtoStataMatrix() of the MyMatrix class to copy the results from bmat and vmat to new Stata matrices. The names of the new Stata matrices are the first and second arguments passed to myWork().
- It uses the SFI method Scalar.setValue() to copy the result from nObs to the new Stata scalar whose name was the third argument passed to myWork().
MyCalcs.java is easy to read, because I put all the details into the MyMatrix, MyCalcsW, and MyLong classes, which I discuss below.
Like all Java plugins for Stata, myWork() uses the return code rc to handle error conditions. Each method called returns zero if all went well, and it returns a nonzero error code if it could not perform the requested job. If the code returned is not zero, myWork() returns it immediately to Stata. The error messages associated with the error conditions are displayed by the methods.
In (3), I noted that bmat and vmat are instances of the MyMatrix class. The sample averages and the VCE are best stored in matrices. To keep things simple and self-contained, I defined a bare-bones matrix class MyMatrix that uses row-major storage and only the methods I needed. Except for the method copyJavatoStataMatrix(), the code for MyMatrix is standard Java, as can be seen in code block 7.
![Plugspy 2 3 1 – Put Your Mac Under Observation Plugspy 2 3 1 – Put Your Mac Under Observation](https://static.macupdate.com/products/48641/s/periscope-pro-logo.png?v=1599554020)
Lines 33–58 contain the code for copyJavatoStataMatrix(). Lines 40 and 49 use SFI methods that I have not yet discussed. Matrix.createMatrix(String sname, int rows, int cols, double val) creates a new Stata matrix with rows rows and cols columns. Each element of this matrix is initialized to value val. sname contains the name of this Stata matrix.
Matrix.storeMatrixAt(String sname, int i, int j, double val) stores the value val in row i and column j of the Stata matrix whose name is contained in sname. The row i and column j are given in zero-based indexing.
In (4), I noted that I used an instance of the MyLong class to hold the number of sample observations. The primitive types in Java cannot be passed by reference, and the standard wrapper types are immutable, so I created < />< />< b=' /> to pass a long counter, nObs, to MyCalcsW.myAve(). When MyCalcsW.myAve() finishes, nObs contains the number of sample observations. The code for MyLong is standard Java, and it is given in code block 8.< />< />
In (5), I note that the methods MyCalcsW.myAve() and MyCalcsW.myV compute the sample averages and the VCE. These are methods in the class MyCalcsW, whose code is given in code block 9.
MyCalsW.myAve() is a Java implementation of the Mata function MyAve(), discussed in Programming an estimation command in Stata: Preparing to write a plugin. It puts the sample averages into the bmat instance of the MyMatrix class, and it puts the number of observations in the sample into nObs. Most of the code for this method is standard Java or uses SFI methods that I have already discussed. Lines 18, 34, and 38 deserve comment.
Line 18 of MyCalcsW.java uses the method incrementValue() of MyLong to increment the number of observations stored in nObs. It increments the current value of nObs by one.
Line 34 uses the incrementByValue() method of MyMatrix. When calculating the sample average and storing it in the jth element of a vector named b, one needs to store b[j] + value into b[j]. In other words, one increments the amount of the jth element in b by value. bmat.incrementByValue(0,var-1, value) increments the element var-1 in bmat by value.
Line 38 uses the divideByScalar() method of MyMatrix. bmat.divideByScalar(z) replaces each element of bmat with that element divided by the amount z.
MyCalsW.myV() is a Java implementation of the Mata function MyV(), discussed in Programming an estimation command in Stata: Preparing to write a plugin. It puts the VCE into the vmat instance of the MyMatrix class. Most of the code for this method is standard Java or uses methods that I have already discussed. Lines 72, 77, and 85 use the MyMatrix methods storevalue() and getValue(). vmat.storeValue(i, j, z) stores the value z into element (i, j) of the vmat instance of MyMatrix. vmat.getValue(i, j) returns the value stored in element (i, j) of the vmat instance of MyMatrix.
Done and undone
I showed how to implement a Java plugin that does the calculations performed by Mata work functions in mymean10.ado and mymean11.ado, as discussed in Programming an estimation command in Stata: Preparing to write a plugin.
Thanks
Thanks to James Hassell of StataCorp for sharing some of his Java knowledge and experience.
Información en españolTitle
Mycobacterium Avium-Intracellulare; MAI; Mycobacterium Avium; Mycobacterium Avium-Intracellulare; MAI; Mycobacterium Avium; Mycobacterium Avium-Intracellulare infectionSee More
Categories:
Mycobacterium There are 3 types of MAC infections.
Plugspy 2 3 1 – Put Your Mac Under Observation Game
- Pulmonary MAC infections - Affect the lungs and are the most common type. These mainly affect elderly women and people who already have lung disease.[2][3]
- Disseminated MAC infections - Have spread throughout the body. This type is usually seen in people with advanced AIDS.[1]
- MAC-associated lymphadenitis - Causes swelling of the
lymph nodes (especially in the neck) and is the most common in young children who have normal immune systems.[3][4]
Plugspy 2 3 1 – Put Your Mac Under Observation Video
scans and identifying the bacteria in cultures of Last updated: 11/8/2018
Mycobacterium The symptoms of pulmonary MAC infection start slowly, get worse over time and may last for weeks to months. People with pulmonary MAC infections may experience
Symptoms of disseminated MAC infection include: [1][4]
- Fever
- Sweating
- Weight loss
- Fatigue
- Diarrhea
- Shortness of breath
- Abdominal pain
Anemia
Mycobacterium avium complex (MAC) infections are caused by two types of bacteria : Mycobacterium avium and Mycobacterium intracellulare.[1] These bacteria are found in many places including water (fresh or salt), household dust, and soil. MAC bacteria get into the body when the bacteria are inhaled into the lungs or swallowed. Most people have MAC bacteria in their bodies and never get sick. MAC bacteria primarily cause illness in people who have poorly working immune systems or lung disease. Touching the same objects or having a close relationship with people who are sick from a MAC infection does not seem to increase the chance of getting sick. MAC infections are not thought to be contagious from one person to another.[3][4]
Mycobacterium avium complex (MAC) infection is caused by bacteria and is not an inherited condition. To become infected with MAC bacteria and get sick, a person must first be exposed to one of the associated types of bacteria.[4]
There have been a few reports of families with more than one family member with a MAC infection. In these families, it is thought that there is a variation in agene or genes involved with the body's immune response. A genetic variant in an immune system gene may make some people more likely to get sick from an infection than others. There are many genes involved in the human immune response, and there is no single gene known to be responsible for MAC infections.[3][4]
There have been a few reports of families with more than one family member with a MAC infection. In these families, it is thought that there is a variation in a
![Observation Observation](https://m.media-amazon.com/images/I/41x+IAxgRML._AC_SY350_.jpg)
Diagnosis of a pulmonary mycobacterium avium complex (MAC) infection is based on a combination of physical exam findings, laboratory test results, and lung x-rays or CT scan results. The laboratory tests include cultures of mucus spit up from the lungs (sputum) and special staining (acid-fast bacillus test). A laboratory culture involves placing cells from a sputum sample in an environment that encourages the bacteria to grow. Results identifying the bacteria may take several days or longer. Because the symptoms of MAC infections are similar to those of other types of infections, other types of infections and diseases must also be ruled out.[3][4]
Diagnosis of disseminated MAC infection is suspected based on symptoms and is confirmed in cultures of blood and oftenlymph node cells. Cultures of cells from urine, stool , liver or bone marrow may also be helpful. CT scans may be used to try to determine the different sites of infection in the body. If pulmonary or disseminated MAC infection is suspected, an HIV test may be done, as well as other tests, to rule out other associated medical conditions.[1][2][3]
A diagnosis of MAC lymphadenitis is confirmed by finding the bacteria in the culture of lymph node cells. These cells are collected by abiopsy of a swollen lymph node.[2][3]
Mycobacterium avium complex (MAC) infection is classified into several different types including:[2][3]Diagnosis of disseminated MAC infection is suspected based on symptoms and is confirmed in cultures of blood and often
A diagnosis of MAC lymphadenitis is confirmed by finding the bacteria in the culture of lymph node cells. These cells are collected by a
- Pulmonary MAC infection, which affects the lungs
- Disseminated MAC infection, which affects many different parts of the body
- MAC lymphadenitis, which causes swollen
lymph nodes
Treatment options for MAC infections vary by type of infection and by the presence of other medical conditions such as AIDS, cystic fibrosis, COPD, or cancer .[3]
Pulmonary MAC infections and disseminated MAC infections are usually treated with a combination of Plugspy 2 3 1 – Put Your Mac Under Observation Deck
For people who have both HIV/AIDS and a MAC infection, treatment usually involves a combination of different antibiotics for the MAC infection and antiretroviral therapy to treat the HIV infection.[1][4]In special circumstances, there is some evidence to suggest that surgery to remove a single spot of infection in one lung can be helpful in people who have had a poor response to drug therapy. Surgery is usually only done when the infection is found in only one lung and the surgery won't cause any long-term harm.[3][4]
Treatment of MAC lymphadenitis usually involves surgical removal of affected lymph nodes. Antibiotics may also be prescribed depending on the severity of infection and the response to surgery.[3][4]
FDA-Approved Treatments
The medication(s) listed below have been approved by the Food and Drug Administration (FDA) as orphan products for treatment of this condition. Learn more orphan products.- Liposomal amikacin(Brand name: Arikayce) - Manufactured by Insmed Incorporated
FDA-approved indication: September 2018, liposomal amikacin (Arikayce) was approved for the treatment of Mycobacterium avium complex (MAC) lung disease as part of a combination antibacterial drug regimen in patients who do not achieve negative sputum cultures after a minimum of 6 consecutive months of a multidrug background regimen therapy.
National Library of Medicine Drug Information Portal
Medline Plus Health Information
The long-term outlook (prognosis ) for people who are sick from mycobacterium avium complex (MAC) infections depends on the type of infection and whether or not the person has other medical conditions or health problems. One published study reviewed the long-term outlook of people with MAC infections with and without other diseases, and found a 75% chance for survival five years after their first diagnosis.[6]
People who are HIV-positive with MAC infections may have a shortened lifespan depending on their immune systems and their response to HIV medications. For people who have had successful treatment, there is still a chance that the infection will come back, so people who have been sick from a MAC infection need to be monitored over time.[2][3]
In HIV-negative people with lung disease from a MAC infection, the treatment success rates range from 20-90% in different studies.[2] People with certain types of lung disease, people who are underweight, and people withanemia are more likely to have a poor outcome than other HIV-negative people affected by a MAC infection.
MAC lymphadenitis in children generally does not impact their health. In some cases, the condition may go away even without treatment.[3]
People who are HIV-positive with MAC infections may have a shortened lifespan depending on their immune systems and their response to HIV medications. For people who have had successful treatment, there is still a chance that the infection will come back, so people who have been sick from a MAC infection need to be monitored over time.[2][3]
In HIV-negative people with lung disease from a MAC infection, the treatment success rates range from 20-90% in different studies.[2] People with certain types of lung disease, people who are underweight, and people with
MAC lymphadenitis in children generally does not impact their health. In some cases, the condition may go away even without treatment.[3]
Research helps us better understand diseases and can lead to advances in diagnosis and treatment. This section provides resources to help you learn about medical research and ways to get involved.
Clinical Research Resources
- ClinicalTrials.gov lists trials that are related to Mycobacterium Avium Complex infections. Click on the link to go to ClinicalTrials.gov to read descriptions of these studies.
Please note: Studies listed on the ClinicalTrials.gov website are listed for informational purposes only; being listed does not reflect an endorsement by GARD or the NIH. We strongly recommend that you talk with a trusted healthcare provider before choosing to participate in any clinical study.
Support and advocacy groups can help you connect with other patients and families, and they can provide valuable services. Many develop patient-centered information and are the driving force behind research for better treatments and possible cures. They can direct you to research, resources, and services. Many organizations also have experts who serve as medical advisors or provide lists of doctors/clinics. Visit the group’s website or contact them to learn about the services they offer. Inclusion on this list is not an endorsement by GARD.
Organizations Supporting this Disease
- NTM Info & Research (supports pulmonary NTM infections)
14411 South Dixie Highway, Suite 205
Palmetto Bay, FL 33176
Telephone: +1-305-901-4686
E-mail: [email protected]
Website: https://ntminfo.org/
These resources provide more information about this condition or associated symptoms. The in-depth resources contain medical and scientific language that may be hard to understand. You may want to review these resources with a medical professional.
Where to Start
- The National Organization for Rare Disorders (NORD) has a report for patients and families about this condition. NORD is a patient advocacy organization for individuals with rare diseases and the organizations that serve them.
In-Depth Information
- Medscape Reference provides information on this topic. You may need to register to view the medical textbook, but registration is free.
- The Monarch Initiative brings together data about this condition from humans and other species to help physicians and biomedical researchers. Monarch’s tools are designed to make it easier to compare the signs and symptoms (phenotypes) of different diseases and discover common features. This initiative is a collaboration between several academic institutions across the world and is funded by the National Institutes of Health. Visit the website to explore the biology of this condition.
- PubMed is a searchable database of medical literature and lists journal articles that discuss Mycobacterium Avium Complex infections. Click on the link to view a sample search on this topic.
- The AIDS Education and Training Center (AETC) offers information on Mycobacterium Avium Complex infections. Click on the link to view this information page.
Questions sent to GARD may be posted here if the information could be helpful to others. We remove all identifying information when posting a question to protect your privacy. If you do not want your question posted, please let us know.
- Currier JS. Mycobacterium avium complex (MAC) infections in HIV-infected patients. UpToDate. 2017; https://www.uptodate.com/contents/mycobacterium-avium-complex-mac-infections-in-hiv-infected-patients.
- Griffith DE. Overview of nontuberculous mycobacterial infections in HIV-negative patients. UpToDate. 2017; https://www.uptodate.com/contents/overview-of-nontuberculous-mycobacterial-infections-in-hiv-negative-patients.
- Daley CL. Mycobacterium avium Complex Disease. Microbiol Spectr. April, 2017; 5(2):https://www.ncbi.nlm.nih.gov/pubmed/28429679.
- Koirala J. Mycobacterium Avium-Intracellulare. Medscape Reference. 2018; http://emedicine.medscape.com/article/222664-overview.
- Disseminated mycobacterium avium complex disease. US Department of Health and Human Services. 2017; https://aidsinfo.nih.gov/guidelines/html/4/adult-and-adolescent-opportunistic-infection/326/mac.
- Diel R, Lipman M, Hoefsloot W. High mortality in patients with Mycobacterium avium complex lung disease: a systematic review. BMC Infect Dis. 2018; 18(206):1-10. https://bmcinfectdis.biomedcentral.com/track/pdf/10.1186/s12879-018-3113-x.